PHP Framework Benchmarks for 2015

(2015/04/22 Addition) This article is out of dated. Please see the latest benchmarks at https://github.com/kenjis/php-framework-benchmark. I've changed my benchmarking policy, the number of frameworks to benchmark has been increased, and version of frameworks has been updated.

CakePHP 3.0 has been released at last, CodeIgniter 3.0 and BEAR.Sunday 1.0 will come soon.

So I benchmarked latest 9 10 PHP frameworks.

  • Phalcon 1.3.4
  • CodeIgniter 3.0-rc3
  • Slim 2.6.2
  • Yii 2.0.4
  • FuelPHP 1.8-dev
  • Silex 1.2.3
  • BEAR.Sunday 1.0.0-rc2
  • CakePHP 3.0.0
  • Symfony 2.6.5
  • Laravel 5.0.20

Benchmark Environment

  • CentOS 6.5 64bit (VM)
    • PHP 5.5.23
      • Zend OPcache v7.0.4-dev
    • Apache 2.2

How to Benchmark

This is what you call "Hello World" benchmark. It is for mesuring minimum overhead (minimum bootstrap) of frameworks. See source code (later) for details.

I ran commands like below to benchmark.

$ ab -c 10 -t 3 http://localhost/codeigniter-3.0/index.php/hello/index

Benchmark Results

(2015/03/31) Following some feedback, tweaked these benchmarks, and updated the results.

Throughput

Requests per second. More is better.

Memory Usage

Peak memory usage by memory_get_peak_usage(true).

Results data

Throughput

(2015/03/30) Current version

framework requests per second relative
phalcon-1.3 1,622.50 20.8
codeigniter-3.0 727.46 9.3
slim-2.6 799.06 10.2
yii-2.0 383.81 4.9
fuel-1.8-dev 312.29 4.0
silex-1.2 352.96 4.5
bear-1.0 357.58 4.6
cake-3.0 256.58 3.3
symfony-2.6 269.91 3.5
laravel-5.0 78.09 1.0

(2015/03/26) Initial version

framework requests per second relative
phalcon-1.3 1,445.99 20.5
codeigniter-3.0 698.69 9.9
yii-2.0 376.68 5.3
fuel-1.8-dev 322.90 4.6
silex-1.2 311.63 4.4
bear-1.0 296.89 4.2
cake-3.0 259.01 3.7
symfony-2.6 122.58 1.7
laravel-5.0 70.63 1.0

Memory usage

(2015/03/30) Current version

framework peak memory relative
phalcon-1.3 0.50 1.0
codeigniter-3.0 0.50 1.0
slim-2.6 0.50 1.0
yii-2.0 1.50 3.0
fuel-1.8-dev 0.75 1.5
silex-1.2 1.00 2.0
bear-1.0 1.00 2.0
cake-3.0 1.00 2.0
symfony-2.6 1.00 2.0
laravel-5.0 2.75 5.5

(2015/03/26) Initial version

framework peak memory relative
phalcon-1.3 0.50 1.0
codeigniter-3.0 0.50 1.0
yii-2.0 1.50 3.0
fuel-1.8-dev 0.75 1.5
silex-1.2 0.75 1.5
bear-1.0 1.00 2.0
cake-3.0 1.00 2.0
symfony-2.6 2.00 4.0
laravel-5.0 3.00 6.0

Comments

(2015/04/22 Updated)

Phalcon is the fastest, CodeIgniter is the second and Silm and CodeIgniter follow.

FuelPHP、Silex、BEAR.Sunday are alike.

Laravel is very heavy. Laravel4 was as fast as Symfony, but Laravel5 has grown much heavier. It seems Laravel5 is heavier than Laravel4.

Source code

Reference

Date: 2015/03/27

Tags: english