> -----Oorspronkelijk bericht----- > Van: [email protected] [mailto:[email protected]] > Verzonden: woensdag 24 februari 2010 18:23 > > That blog posting is puzzling me, if not to say, I believe it is misleading. > > Hector Virgen schrieb: > > Not the most scientific analysis but this guy seems to get better > > performance out of PDO: > > Any of the PHP APIs are just tiny wrappers on top of the underlying C > libraries. Mapping from the C call to a PHP call is always about about > equally fast no matter how you do the mapping - in ext/mysql, ext/mysqli > or PDO_MYSQL. If you compare equivalent PHP API calls with each other > they should be very, very close together in performance. > > I assume the blog posting is comparing apples and oranges, likely > without the blog author being aware of it. For example, PDO is using a > prepared statement emulation by default for MySQL. It could well be that > the blog posting compares a native prepared statement and a non-prepared > statement. Or, the blog posting has been written in 2009, it could be > that for PDO persistent connections had been used whereas for ext/mysqli > non-persistent connections had been used. > > 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.
One thing I think you should keep in mind with this, is that there is a layer in between which is Zend_Db. Although the bare PHP speed might be equal, it might well be that the PDO_MYSQL aligns better with the Zend_Db architecture then ext/mysqli. I would welcome a proper benchmark to test this. If the difference is as big as in the article, it might be a good idea to repeat the test with a profiler attached to see what causes the problem. Vincent de Lau [email protected]
