PEAR DB, ADODB and Metabase are database abstraction libraries.
I decided to benchmark some of the most common database abstraction
libraries using a simple SELECT statement and measure the overhead
compared to using native mysql_* function calls:

Benchmark was to select 82 rows from the products table 200 times.
The tests were repeated 5 times. Connection times were excluded
from the benchmark. Values are in seconds.

MySQL  1.12 1.12 1.17 1.15 1.14
ADODB  1.43 1.47 1.47 1.44 1.45
PEAR   3.14 3.13 3.22 3.12 3.16
M'base 4.99 4.72 4.71 4.71 4.72

          Average  Overhead
MySQL   1.14         -
ADODB   1.45        27%
PEAR     3.15       176%
M'base    4.77       318%

I was still surprised at how slow some of the libraries were, even
though a code inspection had already given strong hints on the expected
performance of the class libraries.


Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5
with MySQL 3.23, all on the same machine.

Source code for these tests is available from

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to