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

Function BenchmarkCompile

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

Source from the content-addressed store, hash-verified

233}
234
235func BenchmarkCompile(b *testing.B) {
236 for _, tst := range policyTests {
237 r := newRunner(tst.name, tst.expr, tst.parseOpts)
238 env, ast, iss := r.compile(b, tst.envOpts, []CompilerOption{})
239 if iss.Err() != nil {
240 b.Fatalf("Compile() failed: %v", iss.Err())
241 }
242 r.setup(b, env, ast)
243 r.bench(b)
244 }
245}
246
247func parsePolicySource(t testing.TB, name string, policySource string, parseOpts ...ParserOption) *Policy {
248 t.Helper()

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