aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks/bm_closure.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
commit4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 (patch)
tree5379629b43d287972916a87637a26251c1b0de5f /test/cpp/microbenchmarks/bm_closure.cc
parente77b3c36d1b3e2033abd19d553748b678c22253f (diff)
Enable clang-tidy as a sanity check, fix up all known failures
Diffstat (limited to 'test/cpp/microbenchmarks/bm_closure.cc')
-rw-r--r--test/cpp/microbenchmarks/bm_closure.cc54
1 files changed, 27 insertions, 27 deletions
diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc
index 458a2ceb13..e603b70889 100644
--- a/test/cpp/microbenchmarks/bm_closure.cc
+++ b/test/cpp/microbenchmarks/bm_closure.cc
@@ -59,7 +59,7 @@ static void BM_ClosureInitAgainstExecCtx(benchmark::State& state) {
grpc_closure c;
while (state.KeepRunning()) {
benchmark::DoNotOptimize(
- GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx));
+ GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_schedule_on_exec_ctx));
}
track_counters.Finish(state);
}
@@ -72,7 +72,7 @@ static void BM_ClosureInitAgainstCombiner(benchmark::State& state) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
benchmark::DoNotOptimize(GRPC_CLOSURE_INIT(
- &c, DoNothing, NULL, grpc_combiner_scheduler(combiner)));
+ &c, DoNothing, nullptr, grpc_combiner_scheduler(combiner)));
}
GRPC_COMBINER_UNREF(&exec_ctx, combiner, "finished");
grpc_exec_ctx_finish(&exec_ctx);
@@ -83,7 +83,7 @@ BENCHMARK(BM_ClosureInitAgainstCombiner);
static void BM_ClosureRunOnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
grpc_closure c;
- GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(&exec_ctx, &c, GRPC_ERROR_NONE);
@@ -100,7 +100,7 @@ static void BM_ClosureCreateAndRun(benchmark::State& state) {
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(
&exec_ctx,
- GRPC_CLOSURE_CREATE(DoNothing, NULL, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_CREATE(DoNothing, nullptr, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
}
grpc_exec_ctx_finish(&exec_ctx);
@@ -115,7 +115,7 @@ static void BM_ClosureInitAndRun(benchmark::State& state) {
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(
&exec_ctx,
- GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx),
+ GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
}
grpc_exec_ctx_finish(&exec_ctx);
@@ -126,7 +126,7 @@ BENCHMARK(BM_ClosureInitAndRun);
static void BM_ClosureSchedOnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
grpc_closure c;
- GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c, GRPC_ERROR_NONE);
@@ -141,8 +141,8 @@ static void BM_ClosureSched2OnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
grpc_closure c1;
grpc_closure c2;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);
@@ -159,9 +159,9 @@ static void BM_ClosureSched3OnExecCtx(benchmark::State& state) {
grpc_closure c1;
grpc_closure c2;
grpc_closure c3;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, grpc_schedule_on_exec_ctx);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);
@@ -182,7 +182,7 @@ static void BM_AcquireMutex(benchmark::State& state) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
gpr_mu_lock(&mu);
- DoNothing(&exec_ctx, NULL, GRPC_ERROR_NONE);
+ DoNothing(&exec_ctx, nullptr, GRPC_ERROR_NONE);
gpr_mu_unlock(&mu);
}
grpc_exec_ctx_finish(&exec_ctx);
@@ -198,7 +198,7 @@ static void BM_TryAcquireMutex(benchmark::State& state) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
if (gpr_mu_trylock(&mu)) {
- DoNothing(&exec_ctx, NULL, GRPC_ERROR_NONE);
+ DoNothing(&exec_ctx, nullptr, GRPC_ERROR_NONE);
gpr_mu_unlock(&mu);
} else {
abort();
@@ -216,7 +216,7 @@ static void BM_AcquireSpinlock(benchmark::State& state) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
gpr_spinlock_lock(&mu);
- DoNothing(&exec_ctx, NULL, GRPC_ERROR_NONE);
+ DoNothing(&exec_ctx, nullptr, GRPC_ERROR_NONE);
gpr_spinlock_unlock(&mu);
}
grpc_exec_ctx_finish(&exec_ctx);
@@ -231,7 +231,7 @@ static void BM_TryAcquireSpinlock(benchmark::State& state) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
if (gpr_spinlock_trylock(&mu)) {
- DoNothing(&exec_ctx, NULL, GRPC_ERROR_NONE);
+ DoNothing(&exec_ctx, nullptr, GRPC_ERROR_NONE);
gpr_spinlock_unlock(&mu);
} else {
abort();
@@ -246,7 +246,7 @@ static void BM_ClosureSchedOnCombiner(benchmark::State& state) {
TrackCounters track_counters;
grpc_combiner* combiner = grpc_combiner_create();
grpc_closure c;
- GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c, GRPC_ERROR_NONE);
@@ -263,8 +263,8 @@ static void BM_ClosureSched2OnCombiner(benchmark::State& state) {
grpc_combiner* combiner = grpc_combiner_create();
grpc_closure c1;
grpc_closure c2;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);
@@ -283,9 +283,9 @@ static void BM_ClosureSched3OnCombiner(benchmark::State& state) {
grpc_closure c1;
grpc_closure c2;
grpc_closure c3;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
+ GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, grpc_combiner_scheduler(combiner));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);
@@ -305,8 +305,8 @@ static void BM_ClosureSched2OnTwoCombiners(benchmark::State& state) {
grpc_combiner* combiner2 = grpc_combiner_create();
grpc_closure c1;
grpc_closure c2;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner1));
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner1));
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner2));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);
@@ -328,10 +328,10 @@ static void BM_ClosureSched4OnTwoCombiners(benchmark::State& state) {
grpc_closure c2;
grpc_closure c3;
grpc_closure c4;
- GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner1));
- GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
- GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_combiner_scheduler(combiner1));
- GRPC_CLOSURE_INIT(&c4, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
+ GRPC_CLOSURE_INIT(&c1, DoNothing, nullptr, grpc_combiner_scheduler(combiner1));
+ GRPC_CLOSURE_INIT(&c2, DoNothing, nullptr, grpc_combiner_scheduler(combiner2));
+ GRPC_CLOSURE_INIT(&c3, DoNothing, nullptr, grpc_combiner_scheduler(combiner1));
+ GRPC_CLOSURE_INIT(&c4, DoNothing, nullptr, grpc_combiner_scheduler(combiner2));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&exec_ctx, &c1, GRPC_ERROR_NONE);