diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-21 10:24:00 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-21 10:24:00 -0800 |
commit | 7f4d30a0321a042d4f8512815c1029cbaad6fac8 (patch) | |
tree | b57bd7f130565b98224eb0dc4f793de162979186 /test | |
parent | 3d826b9e0acf79466726c5ef188975cb3cec45e0 (diff) |
Separate CAS/ADD RMWs
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/microbenchmarks/bm_closure.cc | 15 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/bm_fullstack.cc | 18 |
2 files changed, 24 insertions, 9 deletions
diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index 16d05781bb..03aede35b2 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -65,9 +65,13 @@ class TrackCounters { out << " locks/iter:" << ((double)(gpr_atm_no_barrier_load(&gpr_mu_locks) - mu_locks_at_start_) / (double)state_.iterations()) - << " atm_rmw/iter:" - << ((double)(gpr_atm_no_barrier_load(&gpr_counter_rmw) - - rmw_at_start_) / + << " atm_cas/iter:" + << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_cas) - + atm_cas_at_start_) / + (double)state_.iterations()) + << " atm_add/iter:" + << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_add) - + atm_add_at_start_) / (double)state_.iterations()); #endif state_.SetLabel(out.str()); @@ -77,7 +81,10 @@ class TrackCounters { benchmark::State& state_; #ifdef GPR_LOW_LEVEL_COUNTERS const size_t mu_locks_at_start_ = gpr_atm_no_barrier_load(&gpr_mu_locks); - const size_t rmw_at_start_ = gpr_atm_no_barrier_load(&gpr_counter_rmw); + const size_t atm_cas_at_start_ = + gpr_atm_no_barrier_load(&gpr_counter_atm_cas); + const size_t atm_add_at_start_ = + gpr_atm_no_barrier_load(&gpr_counter_atm_add); #endif }; diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc index 5bb456ab46..48e131f1be 100644 --- a/test/cpp/microbenchmarks/bm_fullstack.cc +++ b/test/cpp/microbenchmarks/bm_fullstack.cc @@ -101,7 +101,8 @@ static void ApplyCommonChannelArguments(ChannelArguments* c) { #ifdef GPR_LOW_LEVEL_COUNTERS extern "C" gpr_atm gpr_mu_locks; -extern "C" gpr_atm gpr_counter_rmw; +extern "C" gpr_atm gpr_counter_atm_cas; +extern "C" gpr_atm gpr_counter_atm_add; #endif class BaseFixture { @@ -113,9 +114,13 @@ class BaseFixture { out << " locks/iter:" << ((double)(gpr_atm_no_barrier_load(&gpr_mu_locks) - mu_locks_at_start_) / (double)s.iterations()) - << " atm_rmw/iter:" - << ((double)(gpr_atm_no_barrier_load(&gpr_counter_rmw) - - rmw_at_start_) / + << " atm_cas/iter:" + << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_cas) - + atm_cas_at_start_) / + (double)s.iterations()) + << " atm_add/iter:" + << ((double)(gpr_atm_no_barrier_load(&gpr_counter_atm_add) - + atm_add_at_start_) / (double)s.iterations()); #endif grpc_memory_counters counters_at_end = grpc_memory_counters_snapshot(); @@ -135,7 +140,10 @@ class BaseFixture { private: #ifdef GPR_LOW_LEVEL_COUNTERS const size_t mu_locks_at_start_ = gpr_atm_no_barrier_load(&gpr_mu_locks); - const size_t rmw_at_start_ = gpr_atm_no_barrier_load(&gpr_counter_rmw); + const size_t atm_cas_at_start_ = + gpr_atm_no_barrier_load(&gpr_counter_atm_cas); + const size_t atm_add_at_start_ = + gpr_atm_no_barrier_load(&gpr_counter_atm_add); #endif grpc_memory_counters counters_at_start_ = grpc_memory_counters_snapshot(); }; |