[TYPO3-dev] SQL parameter binding

Dmitry Dulepov dmitry.dulepov at gmail.com
Mon Jun 14 11:18:06 CEST 2010


Hi!

Jigal van Hemert wrote:
> That's what you keep saying. I can't find any (recent) benchmark results
> on the web for this, but knowing your precise nature you must have some
> results lying around. Can you please share them?

My previous reply was based on investigation that I read from people who
benchmarked PDO and MySQL driver with Zend Framework.

Just now I did a very quick Google search (pdo mysql native speed) and
found some numbers:
http://dealnews.com/developers/php-mysql.html
http://blogs.vinuthomas.com/2006/08/07/benchmark-mysql-mysqli-pdo-in-php/

I chose only pages with some numbers in them regardless of the numbers. See
yourself.

This one is without numbers but says quite clearly
(http://brian.moonspot.net/2006/08/06/mysqli-vs-pdo-my-version/):

============
The recent post by SantosJ reminded me of a write up I did for the dealnews
developer page. His post dealt with the good and bad of coding with PDO.
For me, it was about speed, not ease of use. I will write any freaky code
to save a cycle or two. In my tests (code is on the linked page), I found
that PDO was slower than mysqli in every test except prepared inserts.
Since the bulk of our application (and I suspect, most web apps) is read
bound, that is not a big win for me. I was happy to see however that mysqli
was in no way slower than the trusty old mysql extension. Good job to
whomever did that extension.
============

I am sure if you do a real research, you'll find more interesting numbers.
Or just think of it: PDO is a very abstracted thing. Can it be faster than
a specialized implementation? I guess not. Of course, it can be a matter of
configuration (for example, PDO emulates prepared statements for MySQL by
default).

I would use mysqlnd => mysqli => pdo in that order. For example, TYPO3
could check for availability in that order and use the first available. We
really do not need to slow down TYPO3 even more...

-- 
Dmitry Dulepov
TYPO3 expert / TYPO3 core&security teams member
Twitter: http://twitter.com/dmitryd
Read more @ http://dmitry-dulepov.com/




More information about the TYPO3-dev mailing list