{"id":20900569,"url":"https://github.com/phpbench/benchmarks-containers","last_synced_at":"2025-10-16T02:12:23.366Z","repository":{"id":66173831,"uuid":"42819110","full_name":"phpbench/benchmarks-containers","owner":"phpbench","description":"PHP Container Benchmarks","archived":false,"fork":false,"pushed_at":"2020-02-16T16:17:47.000Z","size":33,"stargazers_count":10,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-19T13:15:41.903Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/phpbench.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-20T15:58:50.000Z","updated_at":"2022-09-28T12:10:00.000Z","dependencies_parsed_at":"2023-02-21T01:30:20.419Z","dependency_job_id":null,"html_url":"https://github.com/phpbench/benchmarks-containers","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/phpbench%2Fbenchmarks-containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpbench%2Fbenchmarks-containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpbench%2Fbenchmarks-containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpbench%2Fbenchmarks-containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpbench","download_url":"https://codeload.github.com/phpbench/benchmarks-containers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243286639,"owners_count":20267018,"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":[],"created_at":"2024-11-18T11:20:45.891Z","updated_at":"2025-10-16T02:12:18.317Z","avatar_url":"https://github.com/phpbench.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Container Benchmarking Suite\n================================\n\n[![Build Status](https://travis-ci.org/phpbench/benchmarks-containers.svg)](https://travis-ci.org/phpbench/benchmarks-containers)\n\nThis benchmarking suite compares PHP Dependency Injection Containers. Its sort\nof an example project for [PHPBench](https://github.com/phpbench/phpbench).\n\nIt is intended to be a base for developing a standard benchmarking suite for\nall of the PHP containers out there.\n\nIncluding:\n\n- [PHP-DI](https://github.com/PHP-DI/PHP-DI).\n- [Symfony Dependency Injection](https://github.com/symfony/DependencyInjection).\n- [Pimple](https://github.com/silexphp/Pimple).\n- [PHPBench Container](https://github.com/phpbench/phpbench).\n- [Illuminate (Laravel) Container](https://github.com/illuminate/container)\n- [Php League Container](http://container.thephpleague.com/)\n- [Zend Service Manager](https://github.com/zendframework/zend-servicemanager)\n- [Aura DI](https://github.com/auraphp/aura.di)\n\nNote that PHPBench Container is not a \"real\" container, but a minimal\nad-hoc call-back based container used by PHPBench itself.\n\nDisclaimer\n----------\n\nWe take no responsiblity for the accuracy of these benchmarks. If you want to\nbe sure of the results please clone this repository, look at the code, and run\nthe benchmarks yourself.\n\nIf you are a container maintainer and you notice that the benchmarks are not\nfair, then please make a pull request.\n\nThe benchmarks do not cover all contingencies, infact they are currently quite\nlimited. Please feel free to make pull requests as required.\n\nVersions\n--------\n\n```\naura/di                             3.1.0   A serializable dependency\ninjection container with constructor and setter injectio...\nilluminate/container                v5.2.28 The Illuminate Container package.\nleague/container                    2.2.0   A fast and intuitive dependency injection container.\nphp-di/php-di                       5.2.2   The dependency injection container\nphpbench/phpbench                   0.11.1  PHP Benchmarking Framework\npimple/pimple                       v3.0.2  Pimple, a simple Dependency\nsymfony/dependency-injection        v2.8.4  Symfony DependencyInjection\nzendframework/zend-servicemanager   3.0.3\n```\n\nResults\n-------\n\n- All containers are expected to be optimized except in the `unoptimized\n  test`.\n\nSubjects (all executed 1000 times):\n\n- `GetOptimizedNode`: Return a shared service (expected cache effect).\n- `GetUnoptimized`: Return a shared service without optimization (i.e. no\n  dumping of the container, etc).\n- `GetPrototype`: Return a new instance of the service.\n- `Lifecycle`: Instantiate the container and return a shared service.\n\n## Suite #1339f97fb7f96efa6de544e9f63f6116e81f85e2 2016-04-07 15:59:32\n\n50 iterations, 1000 revolutions, 5 warmup revolutions, stdev \u003c 3%\n\n### Environment\n\nprovider | key | value\n --- | --- | --- \nuname | os | Linux\nuname | host | dtlt410\nuname | release | 4.2.0-1-amd64\nuname | version | #1 SMP Debian 4.2.6-1 (2015-11-10)\nuname | machine | x86_64\nphp | version | 7.0.3-3\nunix-sysload | l1 | 1.34\nunix-sysload | l5 | 1.16\nunix-sysload | l15 | 0.85\nvcs | system | git\nvcs | branch | master\nvcs | version | ce85c2f9b04832e4a5d0e47ff1a9bf40c3b72090\nbaseline | nothing | 0.015020370483398\nbaseline | md5 | 0.27108192443848\nbaseline | file_rw | 1.3530254364014\n\n### Time\n\nbenchmark | benchGetOptimized | benchGetUnoptimized | benchGetPrototype | benchLifecycle\n --- | --- | --- | --- | --- \nPhpDiBench | 0.330μs | 0.725μs | 5.726μs | 23.315μs\nPhpBenchBench | 0.242μs |  |  | 1.443μs\nIlluminateBench | 0.734μs |  | 3.206μs | 8.128μs\nAuraDiBench | 0.297μs |  | 1.772μs | 8.933μs\nPimpleBench | 0.419μs |  | 1.461μs | 3.728μs\nSymfonyDiBench | 0.433μs | 0.993μs | 0.873μs | 3.783μs\nZendServiceManagerBench | 0.266μs |  | 1.169μs | 3.439μs\nLeagueBench | 0.628μs |  | 1.883μs | 7.628μs\n\n**NOTE**: Memory is `memory_get_peak_usage` after executing the operation 1000 times.\n\n### Memory\n\nbenchmark | benchGetOptimized | benchGetUnoptimized | benchGetPrototype | benchLifecycle\n --- | --- | --- | --- | ---\nPhpDiBench | 1,037,152b | 991,016b | 1,037,152b | 5,881,272b\nPhpBenchBench | 755,912b |  |  | 755,224b\nIlluminateBench | 987,304b |  | 987,312b | 986,624b\nAuraDiBench | 881,248b |  | 881,248b | 880,560b\nPimpleBench | 765,040b |  | 765,040b | 764,352b\nSymfonyDiBench | 917,720b | 1,124,856b | 917,720b | 917,032b\nZendServiceManagerBench | 902,984b |  | 902,984b | 2,992,944b\nLeagueBench | 886,144b |  | 886,144b | 2,716,696b\n\nAlternatively you may look at the latest [travis\nbuild](https://travis-ci.org/phpbench/benchmarks-containers).\n\nRun the Benchmarks\n------------------\n\n````bash\n$ composer install\n$ ./vendor/bin/phpbench run --report=all\n````\n\nor\n\n```bash\n$ ./vendor/bin/phpbench run --store\n$ ./vendor/bin/phpbench show latest --report=all\n```\n\nFor the HTML report:\n\n```\n$ ./vendor/bin/phpbench show latest --report=all --output=container_html\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpbench%2Fbenchmarks-containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpbench%2Fbenchmarks-containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpbench%2Fbenchmarks-containers/lists"}