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

Function BenchmarkEnvExtendEager

cel/env_test.go:1146–1161  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1144}
1145
1146func BenchmarkEnvExtendEager(b *testing.B) {
1147 env, err := NewEnv()
1148 if err != nil {
1149 b.Fatalf("NewEnv() failed: %v", err)
1150 }
1151 for i := 0; i < b.N; i++ {
1152 ext, err := env.Extend()
1153 if err != nil {
1154 b.Fatalf("env.Extend() failed: %v", err)
1155 }
1156 _, iss := ext.Compile("123")
1157 if iss.Err() != nil {
1158 b.Fatalf("env.Compile(123) failed: %v", iss.Err())
1159 }
1160 }
1161}
1162
1163func BenchmarkEnvExtendEagerTypes(b *testing.B) {
1164 env, err := NewEnv(EagerlyValidateDeclarations(true))

Callers

nothing calls this directly

Calls 4

ExtendMethod · 0.95
ErrMethod · 0.80
NewEnvFunction · 0.70
CompileMethod · 0.65

Tested by

no test coverage detected