Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use RunParallel for benchmarks (#139)
Simplifies the benchmarking to 4 cases, baseline and with interceptors for both unary and streaming cases. Switched to `RunParallel` to measure overhead per RPC request rather than grouped by the concurrency setting. Reduced streaming to a single round trip to better compare against unary flows: ``` pkg: connectrpc.com/otelconnect BenchmarkStreamingBase-8 19152 58334 ns/op 534279 B/op 204 allocs/op BenchmarkStreamingWithInterceptor-8 19467 62326 ns/op 546378 B/op 302 allocs/op BenchmarkUnaryBase-8 41461 27704 ns/op 14514 B/op 156 allocs/op BenchmarkUnaryWithInterceptor-8 37642 30383 ns/op 25723 B/op 241 allocs/op PASS ok connectrpc.com/otelconnect 8.435s ``` Previously: ``` goos: darwin goarch: arm64 pkg: connectrpc.com/otelconnect BenchmarkStreamingServerNoOptions-8 693 1491135 ns/op 2763098 B/op 1779 allocs/op BenchmarkStreamingServerClientOption-8 639 1732927 ns/op 3163066 B/op 4751 allocs/op BenchmarkStreamingServerOption-8 646 1579154 ns/op 2981825 B/op 3525 allocs/op BenchmarkStreamingClientOption-8 688 1515430 ns/op 2918297 B/op 3002 allocs/op BenchmarkUnaryOtel-8 5924 198928 ns/op 129339 B/op 1216 allocs/op 2023/10/26 13:37:10 http: TLS handshake error from 127.0.0.1:60015: read tcp 127.0.0.1:60013->127.0.0.1:60015: use of closed network connection BenchmarkUnary-8 6601 183334 ns/op 73278 B/op 791 allocs/op PASS ok connectrpc.com/otelconnect 10.268s ```
- Loading branch information