Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RunParallel for benchmarks #139

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Use RunParallel for benchmarks #139

merged 1 commit into from
Nov 1, 2023

Conversation

emcfarlane
Copy link
Contributor

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

@emcfarlane emcfarlane self-assigned this Oct 26, 2023
}
}
}()
if err := stream.Send(req); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send triggers 2 response on the sever:

for i := 0; i < messagesPerRequest; i++ {
so actually need to read twice to drain the service.

Will update the protos to be a pure ping service in a followup PR to make it simpler for testing.

@akshayjshah akshayjshah merged commit 42fc67a into main Nov 1, 2023
5 checks passed
@akshayjshah akshayjshah deleted the ed/bench branch November 1, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants