{"id":19571408,"url":"https://github.com/torstendittmann/php-rust-extension-benchmark","last_synced_at":"2025-10-10T05:41:45.433Z","repository":{"id":132712161,"uuid":"443203470","full_name":"TorstenDittmann/php-rust-extension-benchmark","owner":"TorstenDittmann","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-31T14:25:41.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T00:45:47.540Z","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/TorstenDittmann.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":"2021-12-30T23:06:42.000Z","updated_at":"2021-12-31T14:25:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4747e1c-070e-4e8f-9427-d91b418201d1","html_url":"https://github.com/TorstenDittmann/php-rust-extension-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TorstenDittmann/php-rust-extension-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorstenDittmann%2Fphp-rust-extension-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorstenDittmann%2Fphp-rust-extension-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorstenDittmann%2Fphp-rust-extension-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorstenDittmann%2Fphp-rust-extension-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TorstenDittmann","download_url":"https://codeload.github.com/TorstenDittmann/php-rust-extension-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TorstenDittmann%2Fphp-rust-extension-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002889,"owners_count":26083468,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-11-11T06:18:49.596Z","updated_at":"2025-10-10T05:41:45.397Z","avatar_url":"https://github.com/TorstenDittmann.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"The purpose of this library is to test out the advantages of a PHP extension written in Rust over the native PHP implementation.\n\n\u003e This experiment uses the [ext-php-rs\n](https://crates.io/crates/ext-php-rs) crate.\n\nThe scenario we are testing is matching a URL against a list of endpoints including placeholders which is used in [utopia-php/framework](https://github.com/utopia-php/framework).\n\n# Usage\n\nFirst you need to compile the Rust code to a PHP extension. It is important to use the `--release` flag (performance wise)!\n```sh\ncargo build --release\n```\n\nTo execute the benchmark you need PHP installed locally.\n\n```sh\n# Linux\nphp -dextension=./target/release/libphp_utopia.so test.php\n# macOS\nphp -dextension=./target/release/libphp_utopia.dylib test.php\n```\n# Usage (Docker)\n\nYou can also run the benchmark without the previous steps using Docker:\n\n```sh\n# build\ndocker build -t php-rust-extenstion-benchmark .\n# run\ndocker run php-rust-extenstion-benchmark\n```\n# Example Benchmark Results\n\u003e Run on an Apple MacBook Pro 13\" 2020 M1 using the Dockerfile\n\n```\n-------------------------\nstarting native.\n-------------------------\nrun 0\nrun 1\nrun 2\nrun 3\nrun 4\nrun 5\nrun 6\nrun 7\nrun 8\nrun 9\n-------------------------\nnative took 2.2196494817734 seconds in average per run.\n-------------------------\n-------------------------\nstarting rust.\n-------------------------\nrun 0\nrun 1\nrun 2\nrun 3\nrun 4\nrun 5\nrun 6\nrun 7\nrun 8\nrun 9\n-------------------------\nrust took 0.30620512962341 seconds in average per run.\n-------------------------\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorstendittmann%2Fphp-rust-extension-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorstendittmann%2Fphp-rust-extension-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorstendittmann%2Fphp-rust-extension-benchmark/lists"}