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

Function OptionsForParam

eval/tests/expression_builder_benchmark_test.cc:79–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77BENCHMARK(BM_RegisterBuiltins);
78
79InterpreterOptions OptionsForParam(BenchmarkParam param, google::protobuf::Arena& arena) {
80 InterpreterOptions options;
81 switch (param) {
82 case BenchmarkParam::kFoldConstants:
83 case BenchmarkParam::kRecursivePlanningWithConstantFolding:
84 options.constant_arena = &arena;
85 options.constant_folding = true;
86 break;
87 case BenchmarkParam::kDefault:
88 case BenchmarkParam::kRecursivePlanning:
89 options.constant_folding = false;
90 break;
91 }
92 switch (param) {
93 case BenchmarkParam::kRecursivePlanning:
94 case BenchmarkParam::kRecursivePlanningWithConstantFolding:
95 options.max_recursion_depth = 48;
96 break;
97 case BenchmarkParam::kDefault:
98 case BenchmarkParam::kFoldConstants:
99 options.max_recursion_depth = 0;
100 break;
101 }
102 return options;
103}
104
105void BM_SymbolicPolicy(benchmark::State& state) {
106 auto param = static_cast<BenchmarkParam>(state.range(0));

Callers 3

ASSERT_OK_AND_ASSIGNFunction · 0.85
RegexPrecompilationBenchFunction · 0.85
BM_StringConcatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected