]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
benchmark: Avoid spawning a goroutine per unary call (#8591)
authorArjan Singh Bal <46515553+arjan-bal@users.noreply.github.com>
Fri, 19 Sep 2025 03:24:11 +0000 (08:54 +0530)
committerGitHub <noreply@github.com>
Fri, 19 Sep 2025 03:24:11 +0000 (08:54 +0530)
commite35080456c7071b6d55887080ef78809c163640c
tree763c5128f3200d555f15e2bcca85c54c05f4e0bb
parent68caa7cb3b876979ba16509d35656dec4c3f0fca
benchmark: Avoid spawning a goroutine per unary call (#8591)

The benchmark client is presently spawning a new goroutine per unary
call and blocking on its completion. Since the spawning goroutine is
blocked, it is more efficient to do the work in the spawning goroutine
itself. This change has the following effect on the [benchmark
performance](https://grafana-dot-grpc-testing.appspot.com/):
1. Unary 8-core: 184k QPS to 233k QPS (+26%)
2. Unary 30-core: 403k QPS to 624k QPS (+54%)

## Tested
* Ran the benchmark on the same GKE cluster to repro the results from
the dashboard.
* Created a docker image with the changes in this PR. Re-ran the
benchmark with the new image.

RELEASE NOTES: N/A
benchmark/worker/benchmark_client.go