{"id":25009311,"url":"https://github.com/tarantool-php/benchmarks","last_synced_at":"2025-04-12T19:09:17.201Z","repository":{"id":57065210,"uuid":"197070033","full_name":"tarantool-php/benchmarks","owner":"tarantool-php","description":"Benchmarks for Tarantool PHP connectors.","archived":false,"fork":false,"pushed_at":"2020-05-02T23:22:55.000Z","size":253,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T19:09:09.775Z","etag":null,"topics":["benchmarking","ext-async","ext-parallel","ext-swoole","performance","tarantool","tarantool-connector"],"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/tarantool-php.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},"funding":{"github":["rybakit"]}},"created_at":"2019-07-15T20:46:09.000Z","updated_at":"2021-06-30T15:56:01.000Z","dependencies_parsed_at":"2022-08-24T14:01:36.612Z","dependency_job_id":null,"html_url":"https://github.com/tarantool-php/benchmarks","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/tarantool-php%2Fbenchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool-php%2Fbenchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool-php%2Fbenchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool-php%2Fbenchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool-php","download_url":"https://codeload.github.com/tarantool-php/benchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618277,"owners_count":21134200,"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":["benchmarking","ext-async","ext-parallel","ext-swoole","performance","tarantool","tarantool-connector"],"created_at":"2025-02-05T04:39:13.114Z","updated_at":"2025-04-12T19:09:17.140Z","avatar_url":"https://github.com/tarantool-php.png","language":"PHP","funding_links":["https://github.com/sponsors/rybakit"],"categories":[],"sub_categories":[],"readme":"# Benchmarks for Tarantool PHP connectors\n\n[![Telegram](https://img.shields.io/badge/Telegram-join%20chat-blue.svg)](https://t.me/tarantool_php)\n\nThis repository contains code to benchmark PHP connectors for [Tarantool](https://www.tarantool.io/en/developers/).\nCurrently, there are two connectors available:\n\n * [tarantool/client](https://github.com/tarantool-php/client) written in pure PHP \n * The official [PECL](https://github.com/tarantool/tarantool-php) extension\n \n*A more detailed explanation of the benchmarks represented in this repository can be found in [this article](https://habr.com/en/company/mailru/blog/480032/).*\n\n\n## Requirements\n\n * PHP 7.1+ (NTS and ZTS)\n * [Composer](https://getcomposer.org/)\n * [Tarantool](https://www.tarantool.io/) 1.7.1+\n * [ext-msgpack](https://github.com/msgpack/msgpack-php) to benchmark `Tarantool\\Client\\Packer\\PeclPacker`\n * ext-async ([fork](https://github.com/dreamsxin/ext-async)) to benchmark connectors in async mode\n * [ext-parallel](https://github.com/krakjoe/parallel) to benchmark connectors in parallel mode\n * [ext-swoole](https://github.com/swoole/swoole-src) to benchmark connectors in async mode\n * [ext-tarantool](https://github.com/tarantool/tarantool-php) to benchmark the official PHP connector\n\n\n## Usage\n\nFirst, make sure you have the [bench.lua](bench.lua) instance running.\n\n\u003e If you want to run it on Docker, execute:\n\u003e\n\u003e ```bash\n\u003e docker run -d --network host --name=tarantool-bench \\\n\u003e    -v $PWD/bench.lua:/bench.lua tarantool/tarantool:2 tarantool /bench.lua\n\u003e ```\n\nThen run\n\n```bash\nmake\n```\n\nto see the usage text and a list of all available benchmarks. For example, to (re)run all benchmarks, execute\n\n```bash\nmake clean bench-all\n```\n\n\u003e Alternatively, you may run benchmarks on Docker using Docker Compose: \n\u003e\n\u003e ```bash\n\u003e docker-compose run --rm benchmarks make clean bench-all\n\u003e ```\n\n\nYou may change default benchmark settings by defining the following environment variables\n(in parentheses are the default values):\n\n * `TNT_BENCH_TARANTOOL_URI` *(`tcp://localhost:3301`)*\n * `TNT_BENCH_TEMPLATE` *(`default.php.tpl`)*\n * `TNT_BENCH_ITERATIONS` *(`5`)*\n * `TNT_BENCH_REVOLUTIONS` *(`10000`)*\n * `TNT_BENCH_RETRY_THRESHOLD` *(`3`)*\n\nFor example:\n\n```bash\nmake clean bench-all TNT_BENCH_REVOLUTIONS=20000 TNT_BENCH_RETRY_THRESHOLD=5 \n```\n\n\n## Results\n\nThe below results were made by running benchmarks on Apple MacBook Pro (2015) on the following environment: \n\n * Linux Fedora 30, kernel 5.3.8-200.fc30.x86_64 \n * Tarantool 2.3.0-115-g5ba5ed37e running on Docker\n * Docker 19.03.3, build a872fc2f86\n * PHP 7.3.11 (cli) (built: Oct 22 2019 08:11:04) ( NTS )\n * PHP 7.3.11 (cli) (built: Oct 22 2019 08:11:04) ( ZTS )\n * tarantool/client 0.6.0\n * rybakit/msgpack 0.6.1\n * ext-tarantool 0.3.2 with the [patch](https://github.com/tarantool/tarantool-php/pull/148/files)\n * ext-msgpack 2.0.3\n * ext-async 0.3.0-8c1da46\n * ext-swoole 4.4.12\n * ext-parallel 1.1.3\n\n#### Sync connectors\n![chart](reports/charts/_sync_connectors.png)\n\n#### Sync client packers\n![chart](reports/charts/_sync_client_packers.png)\n\n#### Sync client protocols\n![chart](reports/charts/_sync_client_protocols.png)\n\n#### Async coroutines\n![chart](reports/charts/_async_coroutines.png)\n\n#### Async connectors\n![chart](reports/charts/_async_connectors.png)\n\n#### Async client protocols\n![chart](reports/charts/_async_client_protocols.png)\n\n#### Swoole coroutines\n![chart](reports/charts/_swoole_coroutines.png)\n\n#### Swoole connectors\n![chart](reports/charts/_swoole_connectors.png)\n\n#### Swoole client protocols\n![chart](reports/charts/_swoole_client_protocols.png)\n\n#### Parallel threads\n![chart](reports/charts/_parallel_threads.png)\n\n#### Parallel connectors\n![chart](reports/charts/_parallel_connectors.png)\n\n#### Parallel client protocols\n![chart](reports/charts/_parallel_client_protocols.png)\n\n#### All extensions\n![chart](reports/charts/_extensions.png)\n\n\n## License\n\nThe library is released under the MIT License. See the bundled [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool-php%2Fbenchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool-php%2Fbenchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool-php%2Fbenchmarks/lists"}