Skip to content

Commit 992a335

Browse files
remove setupServer overhead
Signed-off-by: Said Altury <Said.Altury@ibm.com>
1 parent b59f7ea commit 992a335

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

integration/benchmark/grpc/grpc_bench_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525

2626
func BenchmarkGRPCSingleConnectionCPU(b *testing.B) {
2727
srvEndpoint := setupServer(b, "cpu")
28+
b.ResetTimer()
2829

2930
// we share a single connection among all client goroutines
3031
cli, closeF := setupClient(b, srvEndpoint)
@@ -42,6 +43,7 @@ func BenchmarkGRPCSingleConnectionCPU(b *testing.B) {
4243

4344
func BenchmarkGRPCMultiConnectionCPU(b *testing.B) {
4445
srvEndpoint := setupServer(b, "cpu")
46+
b.ResetTimer()
4547

4648
b.RunParallel(func(pb *testing.PB) {
4749
// each goroutine gets its own client + connection
@@ -62,10 +64,10 @@ func BenchmarkGRPCMultiConnectionCPU(b *testing.B) {
6264

6365
func BenchmarkGRPCSingleConnectionECDSA(b *testing.B) {
6466
srvEndpoint := setupServer(b, "ecdsa")
67+
b.ResetTimer()
68+
6569
cli, closeF := setupClient(b, srvEndpoint)
6670
defer closeF()
67-
68-
b.ResetTimer()
6971
b.RunParallel(func(pb *testing.PB) {
7072
for pb.Next() {
7173
resp, err := cli.CallViewWithContext(b.Context(), "fid", nil)
@@ -78,8 +80,8 @@ func BenchmarkGRPCSingleConnectionECDSA(b *testing.B) {
7880

7981
func BenchmarkGRPCMultiConnectionECDSA(b *testing.B) {
8082
srvEndpoint := setupServer(b, "ecdsa")
81-
8283
b.ResetTimer()
84+
8385
b.RunParallel(func(pb *testing.PB) {
8486
cli, closeF := setupClient(b, srvEndpoint)
8587
defer closeF()

0 commit comments

Comments
 (0)