PHP PDO vs normal mysqli speed performance benchmark [closed]

匿名 (未验证) 提交于 2019-12-03 03:08:02

问题:

i m working on a project about social networking website where speed optimization is very critical.

is PDO is FASTER ?

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

回答1:

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.



回答2:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!