Benchmark mysql, mysqli, pdo in PHP

Here’s an interesting article showing benchmarks between the various libraries used to query MySQL databases. It looks like the mysql and mysqli libraries work much faster than PDO.

Extension Req/Sec
mysqli
164
mysql
162
PDO
88
mysqli (prepared)
86
PDO (prepared)
81

Link: PHP and MySQL, the future

  • Thanks a million!

    I was about to start a big project and was pondering over whether I should use PDO instead of Mysqli! I think I'll just stick to MySqli now!
  • Name
    Pdo may be slower but mysql\mysqli only allow connections to mysql and this does not cut it when you want your application to be able to support multiple databases.

    Correct me if I am wrong but dont most abstraction layers get their performance from using extensions such as mysql\mysqli\pgsql. These are faster than pdo and would probably explain the benchmarks combined with a few other things I wont get into
  • really interesting articles, and i really believe that mysql and mysqli libraries work much faster than PDO.!

    good blog!
  • vinuthomas
    That's a good suggestion. Let me see if I can whip up some benchmarks :)
  • I wouldn't be interested in that, but I dislike the whole PEAR project bigtime. The only thing I liked, PHPUnit, has split out of the project recently, so it's no good.

    I'd be interested in a benchmark between PDO and adoDB though
blog comments powered by Disqus