PHP PDO vs normal mysqli speed performance benchmark [closed]
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 questioni 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
精彩评论