{"id":13622743,"url":"https://github.com/kenjis/php-framework-benchmark","last_synced_at":"2025-05-16T09:04:05.337Z","repository":{"id":23683685,"uuid":"27055316","full_name":"kenjis/php-framework-benchmark","owner":"kenjis","description":"PHP Framework Benchmark","archived":false,"fork":false,"pushed_at":"2023-01-14T05:31:32.000Z","size":10365,"stargazers_count":1028,"open_issues_count":51,"forks_count":161,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-04-09T04:02:30.692Z","etag":null,"topics":["benchmark","php-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenjis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-24T01:21:42.000Z","updated_at":"2025-03-30T13:50:43.000Z","dependencies_parsed_at":"2023-01-16T21:45:11.332Z","dependency_job_id":null,"html_url":"https://github.com/kenjis/php-framework-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fphp-framework-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fphp-framework-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fphp-framework-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fphp-framework-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjis","download_url":"https://codeload.github.com/kenjis/php-framework-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501556,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","php-framework"],"created_at":"2024-08-01T21:01:23.575Z","updated_at":"2025-05-16T09:04:00.324Z","avatar_url":"https://github.com/kenjis.png","language":"PHP","readme":"# PHP Framework Benchmark\n\nThis project attempts to measure minimum overhead (minimum bootstrap cost) of PHP frameworks in the real world.\n\nSo I think the minimum applications to benchmark should not include:\n\n* cost of template engine (HTML output)\n* cost of database manipulation\n* cost of debugging information\n\nComponents like Template engine or ORM/Database libraries are out of scope in this project.\n\n## Benchmarking Policy\n\nThis is `master` branch.\n\n* Install a framework according to the official documentation.\n* Use the default configuration.\n  * Don't remove any components/configurations even if they are not used.\n  * With minimum changes to run this benchmark.\n* Set environment production/Turn off debug mode.\n* Run optimization which you normally do in your production environment, like Composer's `--optimize-autoloader`.\n* Use controller or action class if a framework has the functionality.\n\nSome 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.\n\nBut if you are interested in benchmarking with optimization (removing components/configurations which are not used), See [optimize](https://github.com/kenjis/php-framework-benchmark/tree/optimize) branch.\n\nIf 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.\n\n## Results\n\n### Benchmarking Environment\n\n* CentOS 6.8 64bit (VM; VirtualBox)\n  * PHP 5.6.30 (Remi RPM)\n    * Zend OPcache v7.0.6-dev\n  * Apache 2.2\n\n### Hello World Benchmark\n\nThese are my benchmarks, not yours. **I encourage you to run on your (production equivalent) environments.**\n\n(2017/02/14)\n\n![Benchmark Results Graph](img/php-framework-benchmark-20170214.png)\n\n|framework          |requests per second|relative|peak memory|relative|\n|-------------------|------------------:|-------:|----------:|-------:|\n|siler-0.6          |           2,069.69|    20.3|       0.25|     1.0|\n|kumbia-1.0-dev     |           1,753.60|    17.2|       0.29|     1.2|\n|staticphp-0.9      |           1,665.28|    16.3|       0.27|     1.1|\n|phalcon-2.0        |           1,618.39|    15.9|       0.26|     1.1|\n|tipsy-0.10         |           1,376.97|    13.5|       0.32|     1.3|\n|fatfree-3.5        |             965.16|     9.5|       0.41|     1.7|\n|ci-3.0             |             753.09|     7.4|       0.42|     1.7|\n|nofuss-1.2         |             667.24|     6.5|       0.40|     1.6|\n|slim-3.0           |             550.43|     5.4|       0.61|     2.5|\n|bear-1.0           |             502.52|     4.9|       0.73|     3.0|\n|lumen-5.1          |             415.57|     4.1|       0.85|     3.5|\n|yii-2.0            |             410.08|     4.0|       1.32|     5.4|\n|ze-1.0             |             403.34|     4.0|       0.75|     3.1|\n|cygnite-1.3        |             369.12|     3.6|       0.71|     2.9|\n|fuel-1.8           |             344.26|     3.4|       0.63|     2.6|\n|silex-2.0          |             342.81|     3.4|       0.78|     3.2|\n|phpixie-3.2        |             267.24|     2.6|       1.25|     5.1|\n|aura-2.0           |             233.54|     2.3|       0.88|     3.6|\n|cake-3.2           |             174.91|     1.7|       1.95|     7.9|\n|zf-3.0             |             133.87|     1.3|       2.24|     9.1|\n|symfony-3.0        |             131.50|     1.3|       2.18|     8.9|\n|laravel-5.3        |             101.94|     1.0|       2.83|    11.5|\n\nNote(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.\n\nNote(2): This benchmarks are limited by `ab` performance. See [#62](https://github.com/kenjis/php-framework-benchmark/issues/62).\n\n## How to Benchmark\n\nIf you want to benchmark PHP extension frameworks like Phalcon, you need to install the extenstions.\n\nInstall source code as \u003chttp://localhost/php-framework-benchmark/\u003e:\n\n~~~\n$ git clone https://github.com/kenjis/php-framework-benchmark.git\n$ cd php-framework-benchmark\n$ bash setup.sh\n~~~\n\nRun benchmarks:\n\n~~~\n$ bash benchmark.sh\n~~~\n\nSee \u003chttp://localhost/php-framework-benchmark/\u003e.\n\nIf you want to benchmark some frameworks:\n\n~~~\n$ bash setup.sh fatfree-3.5/ slim-3.0/ lumen-5.1/ silex-1.3/\n$ bash benchmark.sh fatfree-3.5/ slim-3.0/ lumen-5.1/ silex-1.3/\n~~~\n\n## Linux Kernel Configuration\n\nI added below in `/etc/sysctl.conf`\n\n~~~\n# Added\nnet.netfilter.nf_conntrack_max = 100000\nnet.nf_conntrack_max = 100000\nnet.ipv4.tcp_max_tw_buckets = 180000\nnet.ipv4.tcp_tw_recycle = 1\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_fin_timeout = 10\n~~~\n\nand run `sudo sysctl -p`.\n\nIf you want to see current configuration, run `sudo sysctl -a`.\n\n## Apache Virtual Host Configuration\n\n~~~\n\u003cVirtualHost *:80\u003e\n  DocumentRoot /home/vagrant/public\n\u003c/VirtualHost\u003e\n~~~\n\n## References\n\n* [Aura](http://auraphp.com/) ([@auraphp](https://twitter.com/auraphp))\n* [BEAR.Sunday](https://bearsunday.github.io/) ([@BEARSunday](https://twitter.com/BEARSunday))\n* [CakePHP](http://cakephp.org/) ([@cakephp](https://twitter.com/cakephp))\n* [CodeIgniter](http://www.codeigniter.com/) ([@CodeIgniter](https://twitter.com/CodeIgniter))\n* [Cygnite](http://www.cygniteframework.com/) ([@cygnitephp](https://twitter.com/cygnitephp))\n* [FatFree](http://fatfreeframework.com/) ([@phpfatfree](https://twitter.com/phpfatfree))\n* [FuelPHP](http://fuelphp.com/) ([@fuelphp](https://twitter.com/fuelphp))\n* [Ice](http://www.iceframework.org/) ([@iceframework](https://twitter.com/iceframework)) [PHP extension]\n  * See https://github.com/kenjis/php-framework-benchmark/pull/17#issuecomment-98244668\n* [KumbiaPHP](https://github.com/KumbiaPHP/KumbiaPHP) ([@KumbiaPHP](https://twitter.com/KumbiaPHP))\n  * [Install KumbiaPHP](https://github.com/KumbiaPHP/Documentation/blob/master/en/to-install.md#instalar-kumbiaphp)\n* [Laravel](http://laravel.com/) ([@laravelphp](https://twitter.com/laravelphp))\n* [Lumen](http://lumen.laravel.com/)\n* [NoFussFramework](http://www.nofussframework.com/)\n* [Phalcon](http://phalconphp.com/) ([@phalconphp](https://twitter.com/phalconphp)) [PHP extension]\n  * [Installation](https://docs.phalconphp.com/en/latest/reference/install.html)\n* [PHPixie](http://phpixie.com/) ([@phpixie](https://twitter.com/phpixie))\n* [Radar](https://github.com/radarphp/Radar.Project)\n* [Siler](https://github.com/leocavalcante/siler)\n* [Silex](http://silex.sensiolabs.org/)\n* [Slim](http://www.slimframework.com/) ([@slimphp](https://twitter.com/slimphp))\n* [StaticPHP](https://github.com/gintsmurans/staticphp)\n* [Symfony](http://symfony.com/) ([@symfony](https://twitter.com/symfony))\n  * [How to Deploy a Symfony Application](http://symfony.com/doc/current/cookbook/deployment/tools.html)\n* [Tipsy](http://tipsy.la)\n* [Flow-Framework](https://flow.neos.io) ([@neoscms](https://twitter.com/neoscms))\n* [Yii](http://www.yiiframework.com/) ([@yiiframework](https://twitter.com/yiiframework))\n* [zend-expressive](https://github.com/zendframework/zend-expressive) ([@zfdevteam](https://twitter.com/zfdevteam))\n* [Zend Framework](http://framework.zend.com/) ([@zfdevteam](https://twitter.com/zfdevteam))\n\n## Other Benchmarks\n\n* [PHP ORM Benchmark](https://github.com/kenjis/php-orm-benchmark)\n* [PHP User Agent Parser Benchmarks](https://github.com/kenjis/user-agent-parser-benchmarks)\n","funding_links":[],"categories":["PHP","Resources"],"sub_categories":["Development Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fphp-framework-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjis%2Fphp-framework-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fphp-framework-benchmark/lists"}