diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-19 14:39:11 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-19 14:39:11 -0700 |
commit | 5088ef73ebe0049b5440b9216e9eb8a63e0096d0 (patch) | |
tree | 85cc145bf4458dd7422e0f4233cb3b1d7a3c4f4d /test/cpp | |
parent | 767397702e2471a632fab4fd8d7bba59dfd529ac (diff) |
Refine warmup
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index 269bfd658d..e321de0e53 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -49,8 +49,11 @@ extern "C" { DEFINE_bool(log, false, "Log state to CSV files"); DEFINE_int32( + warmup_megabytes, 10, + "Number of megabytes to pump before collecting flow control stats"); +DEFINE_int32( warmup_iterations, 100, - "Number of iterations to warm up before collecting flow control stats"); + "Number of megabytes to pump before collecting flow control stats"); namespace grpc { namespace testing { @@ -280,7 +283,10 @@ static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) { } } }; - for (int i = 0; i < FLAGS_warmup_iterations; i++) { + for (int i = 0; + i < GPR_MAX(FLAGS_warmup_iterations, FLAGS_warmup_megabytes * 1024 * + 1024 / (14 + state.range(0))); + i++) { inner_loop(true); } while (state.KeepRunning()) { @@ -306,7 +312,7 @@ static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) { static void TrickleArgs(benchmark::internal::Benchmark* b) { for (int i = 1; i <= 128 * 1024 * 1024; i *= 8) { - for (int j = 1; j <= 128 * 1024 * 1024; j *= 8) { + for (int j = 64; j <= 128 * 1024 * 1024; j *= 8) { double expected_time = static_cast<double>(14 + i) / (125.0 * static_cast<double>(j)); if (expected_time > 2.0) continue; |