{"id":15380822,"url":"https://github.com/yookoala/benchmark-php-use","last_synced_at":"2025-04-04T19:49:18.565Z","repository":{"id":147456314,"uuid":"212769013","full_name":"yookoala/benchmark-php-use","owner":"yookoala","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-04T08:33:15.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T04:42:28.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/yookoala.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":"2019-10-04T08:27:22.000Z","updated_at":"2019-10-04T08:33:17.000Z","dependencies_parsed_at":"2023-07-24T19:01:37.917Z","dependency_job_id":null,"html_url":"https://github.com/yookoala/benchmark-php-use","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"b97f450eee431adcb25a2a525a2292cfe01be877"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yookoala%2Fbenchmark-php-use","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yookoala%2Fbenchmark-php-use/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yookoala%2Fbenchmark-php-use/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yookoala%2Fbenchmark-php-use/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yookoala","download_url":"https://codeload.github.com/yookoala/benchmark-php-use/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247241134,"owners_count":20906949,"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-10-01T14:24:42.729Z","updated_at":"2025-04-04T19:49:18.545Z","avatar_url":"https://github.com/yookoala.png","language":"PHP","readme":"# Autoloading Benchmark\n\nAims to test [if there is performance difference][1] between:\n\n1. multiple `use` statements to the subclass; and\n2. a single `use` statement to the parent namespace.\n\n[1]: https://stackoverflow.com/questions/58231277/composer-autoload-performance\n\n\n## Preparation\n\nRun the generation script first:\n\n```\nphp gen.php\n```\n\nThen run the 2 examples separately:\n```\nphp example1.php; php example2.php\n```\n\n## Result\n\nWe are testing a ridiculous number (100,000) of subclass here. The difference might\nnot be relevant in real life situation. But there is consistent difference between\nthe 2 examples on my machine:\n\n```\nExample 1 executed in 0.202406\nExample 2 executed in 0.159941\n```\n\nThe 0.04s difference is probably the time need to parse the 999,999 more `use`\nstatements.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyookoala%2Fbenchmark-php-use","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyookoala%2Fbenchmark-php-use","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyookoala%2Fbenchmark-php-use/lists"}