From 777e91d4064b72fb673fae7f58d37b2ae9e051bb Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 2 Jun 2017 09:35:59 -0700 Subject: [PATCH 1/4] Redo unary trickle args sweep --- .../microbenchmarks/bm_fullstack_trickle.cc | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index 9f616fe152f..fcc42618c09 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -101,8 +101,6 @@ class TrickledCHTTP2 : public EndpointPairFixture { } void AddToLabel(std::ostream& out, benchmark::State& state) { - grpc_chttp2_transport* client = - reinterpret_cast(client_transport_); out << " writes/iter:" << ((double)stats_.num_writes / (double)state.iterations()) << " cli_transport_stalls/iter:" @@ -118,8 +116,7 @@ class TrickledCHTTP2 : public EndpointPairFixture { (double)state.iterations()) << " svr_stream_stalls/iter:" << ((double)server_stats_.streams_stalled_due_to_stream_flow_control / - (double)state.iterations()) - << " cli_bw_est:" << (double)client->bdp_estimator.bw_est; + (double)state.iterations()); } void Log(int64_t iteration) { @@ -180,7 +177,6 @@ class TrickledCHTTP2 : public EndpointPairFixture { size_t server_backlog = grpc_trickle_endpoint_trickle(&exec_ctx, endpoint_pair_.server); grpc_exec_ctx_finish(&exec_ctx); - if (update_stats) { UpdateStats((grpc_chttp2_transport*)client_transport_, &client_stats_, client_backlog); @@ -374,7 +370,7 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { stub->AsyncEcho(&cli_ctx, send_request, fixture->cq())); void* t; bool ok; - TrickleCQNext(fixture.get(), &t, &ok, state.iterations()); + TrickleCQNext(fixture.get(), &t, &ok, in_warmup ? -1 : state.iterations()); GPR_ASSERT(ok); GPR_ASSERT(t == tag(0) || t == tag(1)); intptr_t slot = reinterpret_cast(t); @@ -382,7 +378,7 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { senv->response_writer.Finish(send_response, Status::OK, tag(3)); response_reader->Finish(&recv_response, &recv_status, tag(4)); for (int i = (1 << 3) | (1 << 4); i != 0;) { - TrickleCQNext(fixture.get(), &t, &ok, state.iterations()); + TrickleCQNext(fixture.get(), &t, &ok, in_warmup ? -1 : state.iterations()); GPR_ASSERT(ok); int tagnum = (int)reinterpret_cast(t); GPR_ASSERT(i & (1 << tagnum)); @@ -419,17 +415,15 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { } static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) { - // A selection of interesting numbers - const int cli_1024k = 1024 * 1024; - const int cli_32M = 32 * 1024 * 1024; - const int svr_256k = 256 * 1024; - const int svr_4M = 4 * 1024 * 1024; - const int svr_64M = 64 * 1024 * 1024; for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) { - for (auto svr : {svr_256k, svr_4M, svr_64M}) { - for (auto cli : {cli_1024k, cli_32M}) { - b->Args({cli, svr, bw}); - } + b->Args({0, 0, bw}); + for (int i = 1; i <= 128 * 1024 * 1024; i *= 64) { + double expected_time = + static_cast(14 + i) / (125.0 * static_cast(bw)); + if (expected_time > 2.0) continue; + b->Args({i, 0, bw}); + b->Args({0, i, bw}); + b->Args({i, i, bw}); } } } From 6996f577838ccc38f118874837d8260493d4b734 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 2 Jun 2017 10:47:41 -0700 Subject: [PATCH 2/4] Change identity --- test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index fcc42618c09..dc66a2cccd8 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -416,13 +416,12 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) { for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) { - b->Args({0, 0, bw}); for (int i = 1; i <= 128 * 1024 * 1024; i *= 64) { double expected_time = static_cast(14 + i) / (125.0 * static_cast(bw)); if (expected_time > 2.0) continue; - b->Args({i, 0, bw}); - b->Args({0, i, bw}); + b->Args({i, 1, bw}); + b->Args({1, i, bw}); b->Args({i, i, bw}); } } From 8758e1030f75b68192f79b8258d9016bddd09e8d Mon Sep 17 00:00:00 2001 From: ncteisen Date: Fri, 2 Jun 2017 11:36:30 -0700 Subject: [PATCH 3/4] Clang fmt --- test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index dc66a2cccd8..5a16f6b0ef0 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -378,7 +378,8 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { senv->response_writer.Finish(send_response, Status::OK, tag(3)); response_reader->Finish(&recv_response, &recv_status, tag(4)); for (int i = (1 << 3) | (1 << 4); i != 0;) { - TrickleCQNext(fixture.get(), &t, &ok, in_warmup ? -1 : state.iterations()); + TrickleCQNext(fixture.get(), &t, &ok, + in_warmup ? -1 : state.iterations()); GPR_ASSERT(ok); int tagnum = (int)reinterpret_cast(t); GPR_ASSERT(i & (1 << tagnum)); From e9dea378c5effc774086a038aaaf57bb63621d08 Mon Sep 17 00:00:00 2001 From: ncteisen Date: Tue, 6 Jun 2017 17:02:38 -0700 Subject: [PATCH 4/4] Pare down args once more --- test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index 5a16f6b0ef0..c201e2e8678 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -417,7 +417,8 @@ static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) { for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) { - for (int i = 1; i <= 128 * 1024 * 1024; i *= 64) { + b->Args({1, 1, bw}); + for (int i = 64; i <= 128 * 1024 * 1024; i *= 64) { double expected_time = static_cast(14 + i) / (125.0 * static_cast(bw)); if (expected_time > 2.0) continue;