On May 26, 2010, at 1:02 AM, Саша Стаменковић wrote:
Still, I'm not really informed about differences between mysqli and
pdo. When you work with Zend_Db, you can choose between this 2 with
just one config param.
I would like to know which one is faster?
I used to run the full set of Zend_Db unit tests many times a day,
with both PDO_MySQL and MySQLi enabled. There was no noticeable
difference in performance. So that's one anecdotal data point.
No doubt there are some cases that show a difference, and therefore
it's possible to construct a benchmark to magnify the difference. But
in ordinary, realistic usage, I don't think there's any significant
difference.
Certainly other factors (e.g. database indexes and using APC for
caching code and data) can overshadow any small difference between PDO
and MySQLi. Performance experts I listen to say that application
architecture matters far more than technical details like the choice
of API.
I would recommend against micro-optimizing, and especially premature
micro-optimizing.
Regards,
Bill Karwin