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

Function BenchmarkParse

parser/parser_test.go:2338–2355  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2336}
2337
2338func BenchmarkParse(b *testing.B) {
2339 p, err := NewParser(
2340 Macros(AllMacros...),
2341 MaxRecursionDepth(32),
2342 ErrorRecoveryLimit(4),
2343 ErrorRecoveryLookaheadTokenLimit(4),
2344 PopulateMacroCalls(true),
2345 )
2346 if err != nil {
2347 b.Fatal(err)
2348 }
2349 b.ResetTimer()
2350 for n := 0; n < b.N; n++ {
2351 for _, testCase := range testCases {
2352 p.Parse(common.NewTextSource(testCase.I))
2353 }
2354 }
2355}
2356
2357func BenchmarkParseParallel(b *testing.B) {
2358 p, err := NewParser(

Callers

nothing calls this directly

Calls 8

ParseMethod · 0.95
NewTextSourceFunction · 0.92
MaxRecursionDepthFunction · 0.85
ErrorRecoveryLimitFunction · 0.85
PopulateMacroCallsFunction · 0.85
NewParserFunction · 0.70
MacrosFunction · 0.70

Tested by

no test coverage detected