|
|
|
@ -64,8 +64,7 @@ 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( |
|
|
|
|
GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL)); |
|
|
|
|
grpc_completion_queue_destroy(grpc_completion_queue_create_for_next(NULL)); |
|
|
|
|
} |
|
|
|
|
track_counters.Finish(state); |
|
|
|
|
} |
|
|
|
@ -102,8 +101,7 @@ 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(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); |
|
|
|
|
grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); |
|
|
|
|
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); |
|
|
|
|
while (state.KeepRunning()) { |
|
|
|
|
grpc_cq_completion completion; |
|
|
|
@ -122,8 +120,7 @@ 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( |
|
|
|
|
GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, NULL); |
|
|
|
|
grpc_completion_queue* cq = grpc_completion_queue_create_for_pluck(NULL); |
|
|
|
|
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); |
|
|
|
|
while (state.KeepRunning()) { |
|
|
|
|
grpc_cq_completion completion; |
|
|
|
@ -142,8 +139,7 @@ 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(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); |
|
|
|
|
grpc_completion_queue* cq = grpc_completion_queue_create_for_next(NULL); |
|
|
|
|
gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC); |
|
|
|
|
while (state.KeepRunning()) { |
|
|
|
|
grpc_completion_queue_next(cq, deadline, NULL); |
|
|
|
|