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

Function BenchmarkParse

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

Source from the content-addressed store, hash-verified

2354}
2355
2356func BenchmarkParse(b *testing.B) {
2357 p, err := NewParser(
2358 Macros(AllMacros...),
2359 MaxRecursionDepth(32),
2360 ErrorRecoveryLimit(4),
2361 ErrorRecoveryLookaheadTokenLimit(4),
2362 PopulateMacroCalls(true),
2363 )
2364 if err != nil {
2365 b.Fatal(err)
2366 }
2367 b.ResetTimer()
2368 for n := 0; n < b.N; n++ {
2369 for _, testCase := range testCases {
2370 p.Parse(common.NewTextSource(testCase.I))
2371 }
2372 }
2373}
2374
2375func BenchmarkParseParallel(b *testing.B) {
2376 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