Home

Awesome

PHP ORM Benchmark

ORMs to Benchmark

  1. Doctrine ORM v2.5.2
  2. Eloquent ORM (illuminate/database) v4.2.17
  3. FuelPHP Orm 1.7.3
  4. Phalcon ORM 2.0.8
  5. Propel ORM 2.0-dev
  6. Yii ActiveRecord 1.1.16
  7. Yii ActiveRecord 2.0.6

Results

These are my benchmarks, not yours. I encourage you to run on your (production equivalent) environments.

Benchmarking Environment

(2015-12-10)

ormtime (ms)memory (KB)
doctrine109.811310.06
propel251.321144.60
eloquent34.46673.80
yii117.84808.48
fuel11.74389.72
yii29.09835.82
phalcon7.25150.05

If you are interested in other resutls, see OTHER_RESULTS.md.

How to Benchmark

(1) Install this repository and install composer packages.

$ git clone https://github.com/kenjis/php-orm-benchmark.git
$ cd php-orm-benchmark
$ composer install

You may skip Phalcon by running composer install --ignore-platform-reqs, if you do not have it installed.

(2) Set public folder as your web document root. If you access http://localhost/, you can see the results graph.

(3) Configure fuel/app/config/development/db.php.

(4) Create database php_dev and import schema schema/php_dev.sql.

$ php oil r setup:mysql

(5) Generate config file for Propel.

$ php oil r setup:propel2

(6) Run benchmarks.

$ php oil r benchmark

See http://localhost/.

You can get markdown table for the results.

$ php oil r show:result_table

References

Other Benchmarks