{"id":15787480,"url":"https://github.com/dunnock/tonic-bench","last_synced_at":"2025-06-20T10:08:58.655Z","repository":{"id":99985550,"uuid":"234303439","full_name":"dunnock/tonic-bench","owner":"dunnock","description":"End to end naive benchmarks for tonic - Rust grpc implementation","archived":false,"fork":false,"pushed_at":"2020-01-16T22:24:57.000Z","size":391,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T02:12:57.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/dunnock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-01-16T11:16:36.000Z","updated_at":"2024-10-30T12:26:18.000Z","dependencies_parsed_at":"2023-05-11T10:45:24.150Z","dependency_job_id":null,"html_url":"https://github.com/dunnock/tonic-bench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dunnock/tonic-bench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunnock%2Ftonic-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunnock%2Ftonic-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunnock%2Ftonic-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunnock%2Ftonic-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dunnock","download_url":"https://codeload.github.com/dunnock/tonic-bench/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dunnock%2Ftonic-bench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260924533,"owners_count":23083524,"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-04T21:20:33.749Z","updated_at":"2025-06-20T10:08:53.640Z","avatar_url":"https://github.com/dunnock.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"This package contains naive implementation of benchmarks for [tonic](https://docs.rs/tonic/0.1.0/tonic/index.html)\n\n# Test with ghz\n\n```\ncargo run --bin=server --release\n```\n\n\u003e Rust version will start on port 50051\n\n\n```\nghz  --insecure --proto proto/hellobench.proto --call hellobench.Greeter.SayEmpty -d '{}' -n 100000 -c 16 --connections=4 localhost:50051\n```\n```\nSummary:\n  Count:        100000\n  Total:        6.26 s\n  Slowest:      100.07 ms\n  Fastest:      0.16 ms\n  Average:      0.96 ms\n  Requests/sec: 15984.89\n```\n\n## Compile and run go version\n\n```\ncd go\ngo build server.go\nserver\n```\n\n\u003e Go version will start on port 50050, so above ghz should be amended:\n\n```\nghz  --insecure --proto proto/hellobench.proto --call hellobench.Greeter.SayEmpty -d '{}' -n 100000 -c 16 --connections=4 localhost:50051\n```\n```\nSummary:\n  Count:        100000\n  Total:        4.57 s\n  Slowest:      14.45 ms\n  Fastest:      0.11 ms\n  Average:      0.67 ms\n  Requests/sec: 21890.10\n```\n\n\n# Test with Rust client\n\n\nLoad with empty request/response\n\n```\ntarget/release/client --connections=4 --concurency=8 --request=Empty --messages=100000 --port=50051\n```\n```\nElapsed: 20022ms\nprocessed 400000 with 19978 rps\nsuccessful 400000 failed 0 requests\n```\n\nOR Load with string request/response\n\n```\ntarget/release/client --connections=4 --concurency=8 --request=Something --messages=100000 --port=50051\n```\n```\nElapsed: 22059ms\nprocessed 400000 with 18133 rps\nsuccessful 400000 failed 0 requests\n```\n\n# Run with flamegraph\n\n```\nsudo flamegraph target/release/server\n```\n\n![Server flamegraph with string request/response](https://raw.githubusercontent.com/dunnock/tonic-bench/master/flamegraph-server-empty.svg?sanitize=true)\n\n\n# Comparison with plain text hyper http\n\nSimple naive hyper HTTP server on same machine gives about ~3x more requests/responses\n\n```\ncargo run --release --bin=http_server\n```\n```\n❯ ab -n 100000 -c 4 -k http://127.0.0.1:3000/\n...\nConcurrency Level:      4\nTime taken for tests:   3.125 seconds\nRequests per second:    32004.64 [#/sec] (mean)\nTransfer rate:          3500.51 [Kbytes/sec] received\n```\n\n![HTTP1 plaintext server flamegraph](https://raw.githubusercontent.com/dunnock/tonic-bench/master/flamegraph-http-server.svg?sanitize=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunnock%2Ftonic-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdunnock%2Ftonic-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdunnock%2Ftonic-bench/lists"}