diff options
Diffstat (limited to 'test/cpp/microbenchmarks/bm_cq.cc')
-rw-r--r-- | test/cpp/microbenchmarks/bm_cq.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index dac702b08b..f0dede7333 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -47,7 +47,7 @@ static void BM_CreateDestroyCpp2(benchmark::State& state) { TrackCounters track_counters; while (state.KeepRunning()) { grpc_completion_queue* core_cq = - grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue_create_for_next(nullptr); CompletionQueue cq(core_cq); } track_counters.Finish(state); @@ -59,7 +59,8 @@ static void BM_CreateDestroyCore(benchmark::State& state) { while (state.KeepRunning()) { // TODO: sreek Templatize this benchmark and pass completion type and // polling type as parameters - grpc_completion_queue_destroy(grpc_completion_queue_create_for_next(NULL)); + grpc_completion_queue_destroy( + grpc_completion_queue_create_for_next(nullptr)); } track_counters.Finish(state); } @@ -83,7 +84,7 @@ static void BM_Pass1Cpp(benchmark::State& state) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GPR_ASSERT(grpc_cq_begin_op(c_cq, &dummy_tag)); grpc_cq_end_op(&exec_ctx, c_cq, &dummy_tag, GRPC_ERROR_NONE, - DoneWithCompletionOnStack, NULL, &completion); + DoneWithCompletionOnStack, nullptr, &completion); grpc_exec_ctx_finish(&exec_ctx); void* tag; bool ok; @@ -96,16 +97,16 @@ BENCHMARK(BM_Pass1Cpp); static void BM_Pass1Core(benchmark::State& state) { TrackCounters track_counters; // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(grpc_cq_begin_op(cq, NULL)); - grpc_cq_end_op(&exec_ctx, cq, NULL, GRPC_ERROR_NONE, - DoneWithCompletionOnStack, NULL, &completion); + GPR_ASSERT(grpc_cq_begin_op(cq, nullptr)); + grpc_cq_end_op(&exec_ctx, cq, nullptr, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, nullptr, &completion); grpc_exec_ctx_finish(&exec_ctx); - grpc_completion_queue_next(cq, deadline, NULL); + grpc_completion_queue_next(cq, deadline, nullptr); } grpc_completion_queue_destroy(cq); track_counters.Finish(state); @@ -115,16 +116,16 @@ BENCHMARK(BM_Pass1Core); static void BM_Pluck1Core(benchmark::State& state) { TrackCounters track_counters; // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_pluck(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create_for_pluck(nullptr); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GPR_ASSERT(grpc_cq_begin_op(cq, NULL)); - grpc_cq_end_op(&exec_ctx, cq, NULL, GRPC_ERROR_NONE, - DoneWithCompletionOnStack, NULL, &completion); + GPR_ASSERT(grpc_cq_begin_op(cq, nullptr)); + grpc_cq_end_op(&exec_ctx, cq, nullptr, GRPC_ERROR_NONE, + DoneWithCompletionOnStack, nullptr, &completion); grpc_exec_ctx_finish(&exec_ctx); - grpc_completion_queue_pluck(cq, NULL, deadline, NULL); + grpc_completion_queue_pluck(cq, nullptr, deadline, nullptr); } grpc_completion_queue_destroy(cq); track_counters.Finish(state); @@ -134,10 +135,10 @@ BENCHMARK(BM_Pluck1Core); static void BM_EmptyCore(benchmark::State& state) { TrackCounters track_counters; // TODO: sreek Templatize this benchmark and pass polling_type as a param - grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); + grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { - grpc_completion_queue_next(cq, deadline, NULL); + grpc_completion_queue_next(cq, deadline, nullptr); } grpc_completion_queue_destroy(cq); track_counters.Finish(state); |