Skip to content
Snippets Groups Projects
Commit 4bba37c2 authored by Craig Tiller's avatar Craig Tiller
Browse files

Add a no-filter stack for comparison

parent 571b7fff
No related branches found
No related tags found
No related merge requests found
...@@ -251,7 +251,9 @@ static void BM_FilterInitDestroy(benchmark::State &state) { ...@@ -251,7 +251,9 @@ static void BM_FilterInitDestroy(benchmark::State &state) {
grpc_channel_args channel_args = {args.size(), &args[0]}; grpc_channel_args channel_args = {args.size(), &args[0]};
std::vector<const grpc_channel_filter *> filters; std::vector<const grpc_channel_filter *> filters;
filters.push_back(fixture.filter); if (fixture.filter != nullptr) {
filters.push_back(fixture.filter);
}
if (fixture.flags & CHECKS_NOT_LAST) { if (fixture.flags & CHECKS_NOT_LAST) {
filters.push_back(&dummy_filter::dummy_filter); filters.push_back(&dummy_filter::dummy_filter);
} }
...@@ -286,6 +288,8 @@ static void BM_FilterInitDestroy(benchmark::State &state) { ...@@ -286,6 +288,8 @@ static void BM_FilterInitDestroy(benchmark::State &state) {
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
} }
typedef Fixture<nullptr, 0> NoFilter;
BENCHMARK_TEMPLATE(BM_FilterInitDestroy, NoFilter);
typedef Fixture<&dummy_filter::dummy_filter, 0> DummyFilter; typedef Fixture<&dummy_filter::dummy_filter, 0> DummyFilter;
BENCHMARK_TEMPLATE(BM_FilterInitDestroy, DummyFilter); BENCHMARK_TEMPLATE(BM_FilterInitDestroy, DummyFilter);
typedef Fixture<&grpc_client_channel_filter, 0> ClientChannelFilter; typedef Fixture<&grpc_client_channel_filter, 0> ClientChannelFilter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment