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

Function BenchmarkCopyDeclarations

checker/env_test.go:80–92  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

78}
79
80func BenchmarkCopyDeclarations(b *testing.B) {
81 env, err := NewEnv(containers.DefaultContainer, newTestRegistry(b))
82 if err != nil {
83 b.Fatalf("NewEnv() failed: %v", err)
84 }
85 err = env.AddFunctions(stdlib.Functions()...)
86 if err != nil {
87 b.Fatalf("env.AddFunctions(stdlib.Functions()...) failed: %v", err)
88 }
89 for i := 0; i < b.N; i++ {
90 env.validatedDeclarations().Copy()
91 }
92}
93
94func newStdEnv(t *testing.T) *Env {
95 t.Helper()

Callers

nothing calls this directly

Calls 6

AddFunctionsMethod · 0.95
validatedDeclarationsMethod · 0.95
FunctionsFunction · 0.92
NewEnvFunction · 0.70
newTestRegistryFunction · 0.70
CopyMethod · 0.65

Tested by

no test coverage detected