{"id":44773522,"url":"https://github.com/dejurin/php-micro-router-framework-benchmark","last_synced_at":"2026-02-16T06:07:48.464Z","repository":{"id":70228326,"uuid":"167694847","full_name":"dejurin/php-micro-router-framework-benchmark","owner":"dejurin","description":"PHP Micro \u0026 Router Framework Benchmark","archived":false,"fork":false,"pushed_at":"2024-04-25T21:28:55.000Z","size":7017,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T23:33:28.379Z","etag":null,"topics":["benchmark","benchmark-framework","benchmark-scripts","benchmarking-framework","micro-framework","php","php-framework","router","routing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dejurin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-01-26T13:58:59.000Z","updated_at":"2022-01-11T23:11:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbd16291-852c-4703-84ac-d1867639c736","html_url":"https://github.com/dejurin/php-micro-router-framework-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dejurin/php-micro-router-framework-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejurin%2Fphp-micro-router-framework-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejurin%2Fphp-micro-router-framework-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejurin%2Fphp-micro-router-framework-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejurin%2Fphp-micro-router-framework-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dejurin","download_url":"https://codeload.github.com/dejurin/php-micro-router-framework-benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dejurin%2Fphp-micro-router-framework-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29501491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","benchmark-framework","benchmark-scripts","benchmarking-framework","micro-framework","php","php-framework","router","routing"],"created_at":"2026-02-16T06:07:47.934Z","updated_at":"2026-02-16T06:07:48.458Z","avatar_url":"https://github.com/dejurin.png","language":"PHP","funding_links":["https://buymeacoffee.com/deyurii"],"categories":[],"sub_categories":[],"readme":"# PHP Micro \u0026 Router Framework Benchmark\nI often use micro \u0026 router so I decided to do benchmark. This benchmark made thanks to ([@kenjis](https://github.com/kenjis)) [PHP-Framework-Benchmark](https://github.com/kenjis/php-framework-benchmark). I changed ab to awk, added to table \"type of framework\" and something else...\n\n---\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/deyurii)\n\n---\n\n## PHP Framework Benchmark\n\n**! Benchmark with help `wrk` https://github.com/wg/wrk**\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 Linux release 7.6.1810 \n* PHP 7.3.1\n* Apache/2.4.6\n\n### Hello world! Benchmark\n\nThese are my benchmarks, not yours. **I encourage you to run on your (production equivalent) environments.**\n(2019/01/27)\n\n[**Show charts**](https://codepen.io/currencyrate_today/pen/gqrBEa)\n![Requests per second](img/WRK_screenshot-localhost-2019.01.27_1.png)\n![Included files](img/WRK_screenshot-localhost-2019.01.27_2.png)\n![Exec time](img/WRK_screenshot-localhost-2019.01.27_3.png)\n![Memory (MB)](img/WRK_screenshot-localhost-2019.01.27_4.png)\n\n**CentOS 7.6** my server\n* Apache/2.4.6\n* PHP 7.3.1\n\n|framework          |requests per second|relative|peak memory|relative|files|          type|\n|-------------------|------------------:|-------:|----------:|-------:|----:|-------------:|\n|no-framework       |          11,742.54|    19.7|       0.41|     1.0|    1|  no-framework|\n|AltoRouter         |           3,619.92|     6.1|       0.50|     1.2|    6|        router|\n|PHP-Router         |           3,358.57|     5.6|       0.52|     1.3|    8|        router|\n|FastRoute          |           2,463.59|     4.1|       0.55|     1.3|   15|        router|\n|flight             |           1,660.40|     2.8|       0.68|     1.6|   15|         micro|\n|tipsy              |           1,617.18|     2.7|       0.66|     1.6|   16|         micro|\n|limonade           |           1,439.16|     2.4|       1.02|     2.5|    6|         micro|\n|siler-1.3          |           1,397.18|     2.3|       0.88|     2.1|   22|         micro|\n|klein.php          |           1,271.65|     2.1|       0.78|     1.9|   20|        router|\n|bearframework      |           1,065.35|     1.8|       0.94|     2.3|   22|         micro|\n|fatfree            |           1,049.13|     1.8|       1.50|     3.6|    6|         micro|\n|Slim-3.x           |             595.05|     1.0|       1.39|     3.4|   56|         micro|\n\n**macOS Mojave 10.14.2** my desktop\n* Apache/2.4.34\n* PHP 7.3.1 with Zend OPcache v7.3.1\n\n|framework          |requests per second|relative|peak memory|relative|files|          type|\n|-------------------|------------------:|-------:|----------:|-------:|----:|-------------:|\n|no-framework       |           4,573.15|     7.2|       0.37|     1.0|    1|  no-framework|\n|AltoRouter         |           2,617.56|     4.1|       0.47|     1.3|    6|        router|\n|PHP-Router         |           2,417.23|     3.8|       0.47|     1.3|    8|        router|\n|FastRoute          |           1,947.44|     3.1|       0.51|     1.4|   15|        router|\n|flight             |           1,545.02|     2.4|       0.63|     1.7|   15|         micro|\n|tipsy              |           1,410.26|     2.2|       0.61|     1.6|   16|         micro|\n|siler-1.3          |           1,330.79|     2.1|       0.77|     2.1|   22|         micro|\n|klein.php          |           1,246.66|     2.0|       0.74|     2.0|   20|        router|\n|limonade           |           1,193.01|     1.9|       1.00|     2.7|    6|         micro|\n|bearframework      |           1,108.75|     1.8|       0.90|     2.4|   22|         micro|\n|fatfree            |           1,062.73|     1.7|       1.44|     3.9|    6|         micro|\n|Slim-3.x           |             631.79|     1.0|       1.31|     3.5|   56|         micro|\n\nNote(1): This benchmarks are limited by `wrk` https://github.com/wg/wrk performance.\n\n## How to Benchmark\n\nInstall source code as \u003chttp://localhost/php-micro-router-framework-benchmark/\u003e:\n\n~~~\n$ git clone https://github.com/dejurin/php-micro-router-framework-benchmark.git\n$ cd php-micro-router-framework-benchmark\n$ bash setup.sh\n~~~\n\nRun benchmarks:\n\n~~~\n$ bash benchmark.sh\n~~~\n\nSee \u003chttp://localhost/php-micro-router-framework-benchmark/\u003e.\n\nIf you want to benchmark some frameworks:\n\n~~~\n$ bash setup.sh PHP-Router/ flight/ lumen/\n$ bash benchmark.sh PHP-Router/ flight/ lumen/\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## References\n* [PHP Framework Benchmark](https://github.com/kenjis/php-framework-benchmark) ([@kenjis](https://github.com/kenjis))\n* [moneyconvert](https://moneyconvert.net/)\n* [wrk](https://github.com/wg/wrk) - Modern HTTP benchmarking tool\n* [PHP-Router](https://github.com/dannyvankooten/PHP-Router) ([@dannyvankooten](https://github.com/dannyvankooten))\n* [FatFree](http://fatfreeframework.com/) ([@phpfatfree](https://twitter.com/phpfatfree))\n* [Flight](http://flightphp.com/)\n* [Siler](https://github.com/leocavalcante/siler)\n* [Tipsy](http://tipsy.la)\n* [Limonade](https://limonade-php.github.io/)\n* [AltoRouter](http://altorouter.com/)\n* [FastRoute](https://github.com/nikic/FastRoute) ([@nikic](https://github.com/nikic))\n* [Bear Framework](https://bearframework.com/)\n* [Klein.php](https://github.com/klein/klein.php)\n* [Slim](http://www.slimframework.com/) ([@slimphp](https://twitter.com/slimphp))\n* [Ham](https://github.com/radiosilence/Ham)\n* [yolo](https://yolophp.computer/)\n* [mu](https://github.com/jeremeamia/mu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdejurin%2Fphp-micro-router-framework-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdejurin%2Fphp-micro-router-framework-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdejurin%2Fphp-micro-router-framework-benchmark/lists"}