MCPcopy Create free account
hub / github.com/cel-expr/cel-go / BenchmarkCompile

Function BenchmarkCompile

policy/compiler_test.go:281–291  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

279}
280
281func BenchmarkCompile(b *testing.B) {
282 for _, tst := range policyTests {
283 r := newRunner(tst.name, tst.expr, tst.parseOpts)
284 env, ast, iss := r.compile(b, tst.envOpts, []CompilerOption{})
285 if iss.Err() != nil {
286 b.Fatalf("Compile() failed: %v", iss.Err())
287 }
288 r.setup(b, env, ast)
289 r.bench(b)
290 }
291}
292
293func newRunner(name, expr string, parseOpts []ParserOption, opts ...cel.EnvOption) *runner {
294 return &runner{

Callers

nothing calls this directly

Calls 5

newRunnerFunction · 0.85
compileMethod · 0.80
ErrMethod · 0.80
setupMethod · 0.80
benchMethod · 0.80

Tested by

no test coverage detected