• Stars
    star
    1,038
  • Rank 44,388 (Top 0.9 %)
  • Language
    PHP
  • Created almost 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PHP Framework Benchmark

PHP Framework Benchmark

This project attempts to measure minimum overhead (minimum bootstrap cost) of PHP frameworks in the real world.

So I think the minimum applications to benchmark should not include:

  • cost of template engine (HTML output)
  • cost of database manipulation
  • cost of debugging information

Components like Template engine or ORM/Database libraries are out of scope in this project.

Benchmarking Policy

This is master branch.

  • Install a framework according to the official documentation.
  • Use the default configuration.
    • Don't remove any components/configurations even if they are not used.
    • With minimum changes to run this benchmark.
  • Set environment production/Turn off debug mode.
  • Run optimization which you normally do in your production environment, like Composer's --optimize-autoloader.
  • Use controller or action class if a framework has the functionality.

Some people may think using default configuration is not fair. But I think a framework's default configuration is an assertion of what it is. Default configuration is a good starting point to know a framework. And I can't optimize all the frameworks. Some frameworks are optimized, some are not, it is not fair. So I don't remove any components/configurations.

But if you are interested in benchmarking with optimization (removing components/configurations which are not used), See optimize branch.

If you find something wrong with my code, please feel free to send Pull Requests. But please note optimizing only for "Hello World" is not acceptable. Building fastest "Hello World" application is not the goal in this project.

Results

Benchmarking Environment

  • CentOS 6.8 64bit (VM; VirtualBox)
    • PHP 5.6.30 (Remi RPM)
      • Zend OPcache v7.0.6-dev
    • Apache 2.2

Hello World Benchmark

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

(2017/02/14)

Benchmark Results Graph

framework requests per second relative peak memory relative
siler-0.6 2,069.69 20.3 0.25 1.0
kumbia-1.0-dev 1,753.60 17.2 0.29 1.2
staticphp-0.9 1,665.28 16.3 0.27 1.1
phalcon-2.0 1,618.39 15.9 0.26 1.1
tipsy-0.10 1,376.97 13.5 0.32 1.3
fatfree-3.5 965.16 9.5 0.41 1.7
ci-3.0 753.09 7.4 0.42 1.7
nofuss-1.2 667.24 6.5 0.40 1.6
slim-3.0 550.43 5.4 0.61 2.5
bear-1.0 502.52 4.9 0.73 3.0
lumen-5.1 415.57 4.1 0.85 3.5
yii-2.0 410.08 4.0 1.32 5.4
ze-1.0 403.34 4.0 0.75 3.1
cygnite-1.3 369.12 3.6 0.71 2.9
fuel-1.8 344.26 3.4 0.63 2.6
silex-2.0 342.81 3.4 0.78 3.2
phpixie-3.2 267.24 2.6 1.25 5.1
aura-2.0 233.54 2.3 0.88 3.6
cake-3.2 174.91 1.7 1.95 7.9
zf-3.0 133.87 1.3 2.24 9.1
symfony-3.0 131.50 1.3 2.18 8.9
laravel-5.3 101.94 1.0 2.83 11.5

Note(1): All the results are run on php with phalcon.so and ice.so. If you don't load phalcon.so or ice.so, the rps except for Phalcon or Ice probably increase a bit.

Note(2): This benchmarks are limited by ab performance. See #62.

How to Benchmark

If you want to benchmark PHP extension frameworks like Phalcon, you need to install the extenstions.

Install source code as http://localhost/php-framework-benchmark/:

$ git clone https://github.com/kenjis/php-framework-benchmark.git
$ cd php-framework-benchmark
$ bash setup.sh

Run benchmarks:

$ bash benchmark.sh

See http://localhost/php-framework-benchmark/.

If you want to benchmark some frameworks:

$ bash setup.sh fatfree-3.5/ slim-3.0/ lumen-5.1/ silex-1.3/
$ bash benchmark.sh fatfree-3.5/ slim-3.0/ lumen-5.1/ silex-1.3/

Linux Kernel Configuration

I added below in /etc/sysctl.conf

# Added
net.netfilter.nf_conntrack_max = 100000
net.nf_conntrack_max = 100000
net.ipv4.tcp_max_tw_buckets = 180000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 10

and run sudo sysctl -p.

If you want to see current configuration, run sudo sysctl -a.

Apache Virtual Host Configuration

<VirtualHost *:80>
  DocumentRoot /home/vagrant/public
</VirtualHost>

References

Other Benchmarks

More Repositories

1

ci-phpunit-test

An easier way to use PHPUnit with CodeIgniter 3.x.
PHP
581
star
2

codeigniter-composer-installer

Installs the offical CodeIgniter 3 with secure folder structure via Composer
PHP
378
star
3

codeigniter-ss-twig

A Simple and Secure Twig integration for CodeIgniter 3.x and 4.x
PHP
161
star
4

php-orm-benchmark

PHP ORM Benchmark
PHP
144
star
5

codeigniter-cli

Cli for CodeIgniter 3.0
PHP
93
star
6

ci3-to-4-upgrade-helper

CodeIgniter 3 to 4 Upgrade Helper
PHP
64
star
7

codeigniter-deployer

A Deployment Tool for CodeIgniter 3.0
PHP
62
star
8

fuelphp1st

電子書籍『はじめてのフレームワークとしての FuelPHP』(初版) サポートサイト
PHP
36
star
9

ci-app-for-ci-phpunit-test

CodeIgniter Test Application for ci-phpunit-test
PHP
30
star
10

user-agent-parser-benchmarks

PHP User Agent Parser Benchmarks
PHP
29
star
11

codeigniter-tettei-apps

『CodeIgniter徹底入門』のサンプルアプリケーション(CodeIgniter v3.1版)
PHP
28
star
12

codeigniter-doctrine

A simple Doctrine integration for CodeIgniter 3.x
PHP
23
star
13

ci4-qrcode

Sample of CodeIgniter 3 QR Code upgraded to CodeIgniter4 using ci3-to-4-upgrade-helper
PHP
22
star
14

codeigniter3-filename-checker

CodeIgniter3 Filename Checker
PHP
22
star
15

ci4-attribute-routes

CodeIgniter4 Attribute Routes. You can set Routes in Controllers as PHP8 Attributes.
PHP
21
star
16

vagrant-fuelphp-centos6

FuelPHP Vagrant Development setup (CentOS6)
Ruby
21
star
17

vagrant-centos6-php

Vagrant CentOS 6.5 PHP 5.5 Development Environment
HTML
20
star
18

ci4-app-template

CodeIgniter4 Application Template - This template changes the CI4 default config more secure.
PHP
19
star
19

codeigniter3-namespaced-controller

CodeIgniter3 Namespaced Controller
HTML
17
star
20

ci4-viewi-demo

CodeIgniter4 Viewi Demo
PHP
15
star
21

perfect-php-mini-blog

書籍『パーフェクト PHP』のミニブログアプリケーションです。
PHP
15
star
22

codeigniter4-matome

CodeIgniter 4 まとめ
Shell
14
star
23

codeigniter-widgets

CodeIgniter Widget (View Partial) Sample
PHP
14
star
24

fuelphp-tools

Tools for FuelPHP 1.x
PHP
13
star
25

ci4-composer-installer

You can install previous versions of CodeIgniter 4 app starter.
PHP
13
star
26

sample-contact-form

FuelPHP で作成した「コンタクトフォーム」のサンプルです。
PHP
13
star
27

codeigniter4-multiple-apps-sample

Running Multiple Applications with one CodeIgniter Installation
PHP
11
star
28

codeigniter-simple-module

CodeIgniter Simple Module
PHP
11
star
29

ci-hmvc-ci-phpunit-test

CodeIgniter HMVC and ci-phpunit-test
PHP
7
star
30

vagrant-centos7-php

Vagrant CentOS 7.1 PHP Development Environment
Shell
7
star
31

php-csp-nonce-source

CSP (Content Security Policy) nonce-source for PHP
PHP
6
star
32

fuelphp-advent-calendar-2012

FuelPHP Advent Calendar 2012 電子書籍作成用
PHP
6
star
33

ci4-shield-test

CodeIgniter4 Shield Test
PHP
6
star
34

ci4-file-upload

CodeIgniter 4 File Upload
PHP
5
star
35

fibonacci-benchmark

Fibonacci Benchmark
Shell
5
star
36

phpunit-helper

Helpers for PHPUnit. Easy mock creation and easy private property/method testing.
PHP
5
star
37

epub-converter

EPUB to KOBO EPUB converter
PHP
5
star
38

monkey-patch

Standalone package of ci-phpunit-test's Monkey Patching.
PHP
5
star
39

ci4-validation-tutorial

CodeIgniter 4 Validation Tutorial
PHP
5
star
40

codeigniter-twig-samples

CodeIgniter Twig Samples
PHP
5
star
41

fuelphp1st-2nd

『はじめてのフレームワークとしてのFuelPHP 第2版(改訂版)』サポートサイト
PHP
5
star
42

ci4-news

CodeIgniter 4 News Tutorial
PHP
5
star
43

ci4-tettei-apps

『CodeIgniter徹底入門』のサンプルアプリケーション (CodeIgniter v4.x版)
PHP
4
star
44

ci3-like-captcha

CodeIgniter3-like Captcha
PHP
4
star
45

AutoMySQLBackup

Fork of https://sourceforge.net/projects/automysqlbackup/
Shell
4
star
46

fuel-simplerauth

FuelPHP SimplerAuth Package
PHP
4
star
47

ci4-for-000webhost

CodeIgniter 4 for 000webhost.com
PHP
4
star
48

ci3-to-4-news

Sample of CodeIgniter3 News Tutorial upgraded to CodeIgniter4 using ci3-to-4-upgrade-helper
PHP
3
star
49

ci4-online-games-store

Sample of CodeIgniter3 Online Game Store upgraded to CodeIgniter4 using ci3-to-4-upgrade-helper
PHP
3
star
50

ci3-news

CodeIgniter 3 News Tutorial
PHP
3
star
51

imadoki-codeigniter-phpunit

イマドキのCodeIgniterでPHPUnit入門
PHP
3
star
52

OreOrePHP

A simple and fast PHP 5.4+ "glue" framework with minimal learning cost.
PHP
3
star
53

ci4-modules-test

CodeIgniter4 Code Modules Test
PHP
3
star
54

fuelphp1st-2nd-contact-form

『はじめてのフレームワークとしてのFuelPHP 第2版(改訂版)』のコンタクトフォーム
PHP
3
star
55

crowdin-file-manager

PHP
2
star
56

NagoyaPHP.Vol17

「非三連数 2017.8.5」の解答例
PHP
2
star
57

my-ciunit

CIUnit for CodeIgniter 2.0. This is a migration of the unmaintained my-ciunit bitbucket repo.
PHP
2
star
58

ci4-twig-sample

CodeIgniter 4 Twig Sample
PHP
2
star
59

Kenjis.Contact

BEAR.Sunday Sample Contact Form
PHP
2
star
60

FuelIgniter

PHP
2
star
61

Nagoya.php.vol.9-DouKaku

PHP
2
star
62

ci4-viewi-tour-of-heroes

CodeIgniter4 Viewi Tour of Heroes app
PHP
2
star
63

secure-validator

Secure Validator is a library for input validation.
PHP
1
star
64

codeigniter-restserver-with-ci-phpunit-test

PHP
1
star
65

toggl-time-entry-pusher

PHP
1
star
66

php-code-benchmarks

PHP Code Benchmarks
PHP
1
star
67

fuelphp-1.x-composer

FuelPHP 1.x Composer Setup
PHP
1
star
68

csv-maker-for-bookcyber

売りたい書籍のCSVファイル作成 for 電脳書房
PHP
1
star
69

Nagoya.php.vol.7-DouKaku

第27回オフラインリアルタイムどう書く「分岐と行き止まり」のPHPによる解答例
PHP
1
star
70

Nagoya.php.vol6-DouKaku

第21回オフラインリアルタイムどう書く「レッスンは何曜日?」のPHPによる解答例
PHP
1
star
71

CodeIgniter_2.1.0_Tutorial

CodeIgniter 2.1.0 and its Official Tutorial Source Code
PHP
1
star
72

ci4-model-update-danger

PHP
1
star
73

NagoyaPHP.Vol12

「バス代 〜 横へな 2013.4.6」の解答例
PHP
1
star
74

ci4-qb-batch-sample

CodeIgniter 4 QueryBuilder Batch Sample
PHP
1
star
75

ci4-session-in-plain-php

Using CodeIgniter4 Session in Plain PHP
PHP
1
star
76

fuelphp-advent-calendar-2013

FuelPHP Advent Calendar 2013 電子書籍作成用
PHP
1
star