开发者

PHP PDO vs normal mysqli speed performance benchmark [closed]

开发者 https://www.devze.com 2023-03-14 03:13 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this po
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 9 years ago.

Improve this question

i m working on a project about social networking website where speed optimization is 开发者_如何学Cvery critical.

is PDO is FASTER ?

i am thinking to switch to PDO is it recommended for use PDO for such a site ?


I doubt using PDO or MySQLi will be bottleneck, though, if you ask for bechmarks, here they are (nothing serious, just couple of tests).

In general, using one or another is a matter of taste, and bottlenecks usually are somewhere else (e.g., queries, indexes, PHP code etc).

One thing you might consider is using some DB wrapper, i.e., class that uses either PDO or MySQLi, whichever you prefer. In your code, use this wrapper instead of using PDO or MySQLi directly. If you do this, you'll be able to switch between PDO, MySQLi or any other library by changing single class instead of changing all the code.


I did a mini benchmark on this a while back. Conclusion. PDO and MySQLi are very similar but the features in PDO are worth using.

http://cznp.com/blog/2/apples-and-oranges-mysqli-and-pdo

0

精彩评论

暂无评论...
验证码 换一张
取 消