On Feb 24, 2010, at 9:23 AM, Ulf Wendel wrote:

Moral is, forget about API performance. There's not much to squeeze out of how you map the very same underlying C library calls into PHP API calls. But it can help a lot to use proper API calls for the task.


For those who don't know, Ulf was the lead for the mysqlnd driver. So I'd say he knows about this issue. :-)

I agree (for what it's worth). In 2008, I gave the following answer for a similar question about the performance of ext/mysql versus ext/ mysqli. I believe the same applies when comparing ext/pdo_mysql.
The MySQL extension is very slightly faster than MySQLi in most benchmarks I've seen reported. The difference is so slight, however, that this should probably not be your criterion for deciding between the two.

Other factors dwarf the difference in performance between mysql and mysqli. Using mod_php or FastCGI, a bytecode cache like APC, or using data caching judiciously to reduce database hits, are far more beneficial for overall performance of PHP scripts than the choice of MySQL extension.

Don't be penny wise and pound foolish! :-)

http://stackoverflow.com/questions/171400/which-is-fastest-in-php-mysql-or-mysqli/171445#171445



Regards,

Bill Karwin

Reply via email to