MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / BM_NestedComprehension

Function BM_NestedComprehension

eval/tests/expression_builder_benchmark_test.cc:238–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236BENCHMARK(BM_EnumResolution256Candidate)->ThreadRange(1, 32);
237
238void BM_NestedComprehension(benchmark::State& state) {
239 auto param = static_cast<BenchmarkParam>(state.range(0));
240 state.SetLabel(LabelForParam(param));
241
242 ASSERT_OK_AND_ASSIGN(ParsedExpr expr, parser::Parse(R"(
243 [4, 5, 6].all(x, [1, 2, 3].all(y, x > y) && [7, 8, 9].all(z, x < z))
244 )"));
245
246 google::protobuf::Arena arena;
247 InterpreterOptions options = OptionsForParam(param, arena);
248
249 auto builder = CreateCelExpressionBuilder(options);
250 auto reg_status = RegisterBuiltinFunctions(builder->GetRegistry());
251 ASSERT_OK(reg_status);
252
253 for (auto _ : state) {
254 ASSERT_OK_AND_ASSIGN(
255 auto expression,
256 builder->CreateExpression(&expr.expr(), &expr.source_info()));
257 arena.Reset();
258 }
259}
260
261BENCHMARK(BM_NestedComprehension)
262 ->Arg(BenchmarkParam::kDefault)

Callers

nothing calls this directly

Calls 1

LabelForParamFunction · 0.85

Tested by

no test coverage detected