{"id":19333194,"url":"https://github.com/pgrimaud/phpbench","last_synced_at":"2026-06-15T08:31:34.747Z","repository":{"id":66326600,"uuid":"252842537","full_name":"pgrimaud/phpbench","owner":"pgrimaud","description":"Some personal PHP benchmarks - Very nice! WoW!","archived":false,"fork":false,"pushed_at":"2024-02-13T13:38:49.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T07:24:22.280Z","etag":null,"topics":["benchmarking","php","php-benchmark","phpben"],"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/pgrimaud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"github":"pgrimaud","custom":"https://www.paypal.me/grimaudpierre"}},"created_at":"2020-04-03T21:10:37.000Z","updated_at":"2024-02-13T13:36:54.000Z","dependencies_parsed_at":"2024-12-19T00:46:36.012Z","dependency_job_id":null,"html_url":"https://github.com/pgrimaud/phpbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pgrimaud/phpbench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Fphpbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Fphpbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Fphpbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Fphpbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgrimaud","download_url":"https://codeload.github.com/pgrimaud/phpbench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrimaud%2Fphpbench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34355157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["benchmarking","php","php-benchmark","phpben"],"created_at":"2024-11-10T02:50:34.285Z","updated_at":"2026-06-15T08:31:34.725Z","avatar_url":"https://github.com/pgrimaud.png","language":"PHP","funding_links":["https://github.com/sponsors/pgrimaud","https://www.paypal.me/grimaudpierre"],"categories":[],"sub_categories":[],"readme":"# PHPBench\nSome PHP benchmarks - Very nice! WoW!\n\nBased on [phpbench/phpbench](https://github.com/phpbench/phpbench).\n\n## Installation\n\n```\ncomposer install\n```\n\n## Usage\n\nRun all tests\n\n```\nbin/bench benchmarks \n```\n\nRun specific test\n\n```\nbin/bench benchmarks/GetFirstElementOfArray.php\n```\n\n## Results\n\n[Get first element of array](https://github.com/pgrimaud/phpbench/blob/master/benchmarks/GetFirstElementOfArray.php)\n\n```shell script\n+-------------------+---------+-------+\n| subject           | mean    | diff  |\n+-------------------+---------+-------+\n| benchWithFirstKey | 0.048μs | 1.00x |\n| benchWithCurrent  | 0.060μs | 1.27x |\n| benchWithForeach  | 0.065μs | 1.36x |\n| benchWithReset    | 0.107μs | 2.25x |\n+-------------------+---------+-------+\n```\n\n[Remove last element of tiny array (10 entries)](https://github.com/pgrimaud/phpbench/blob/master/benchmarks/RemoveLastElementOfTinyArray.php)\n\n```shell script\n+------------------------------------+---------+-------+\n| subject                            | mean    | diff  |\n+------------------------------------+---------+-------+\n| benchWithUnset                     | 0.117μs | 1.00x |\n| benchWithArraySlice                | 0.135μs | 1.15x |\n| benchWithArrayPop                  | 0.145μs | 1.24x |\n| benchWithArrayReverseAndArrayShift | 0.253μs | 2.17x |\n+------------------------------------+---------+-------+\n```\n\n[Remove last element of large array (10000 entries)](https://github.com/pgrimaud/phpbench/blob/master/benchmarks/RemoveLastElementOfLargeArray.php)\n\n```shell script\n+------------------------------------+----------+-------+\n| subject                            | mean     | diff  |\n+------------------------------------+----------+-------+\n| benchWithArrayPop                  | 31.149μs | 1.00x |\n| benchWithUnset                     | 32.279μs | 1.04x |\n| benchWithArraySlice                | 33.904μs | 1.09x |\n| benchWithArrayReverseAndArrayShift | 94.314μs | 3.03x |\n+------------------------------------+----------+-------+\n```\n\n[Create new object](https://github.com/pgrimaud/phpbench/blob/master/benchmarks/CreateNewObject.php) (thanks [@nicolasbonnici](https://github.com/nicolasbonnici))\n\n```shell script\n+-------------------------------+---------+-------+\n| subject                       | mean    | diff  |\n+-------------------------------+---------+-------+\n| benchWithArrayAndCast         | 0.086μs | 1.00x |\n| benchWithAnonymousDeclaration | 0.088μs | 1.02x |\n| benchWithJsonEncode           | 0.114μs | 1.32x |\n| benchWithSdtClass             | 0.124μs | 1.44x |\n+-------------------------------+---------+-------+\n```\n\n## LICENSE\nLicensed under the terms of the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrimaud%2Fphpbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgrimaud%2Fphpbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrimaud%2Fphpbench/lists"}