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

Function BenchmarkParseParallel

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

Source from the content-addressed store, hash-verified

2374}
2375
2376func BenchmarkParseParallel(b *testing.B) {
2377 p, err := NewParser(
2378 Macros(AllMacros...),
2379 MaxRecursionDepth(32),
2380 ErrorRecoveryLimit(4),
2381 ErrorRecoveryLookaheadTokenLimit(4),
2382 PopulateMacroCalls(true),
2383 )
2384 if err != nil {
2385 b.Fatal(err)
2386 }
2387 b.ResetTimer()
2388 b.RunParallel(func(pb *testing.PB) {
2389 for pb.Next() {
2390 for _, testCase := range testCases {
2391 p.Parse(common.NewTextSource(testCase.I))
2392 }
2393 }
2394 })
2395}
2396
2397type benchTestInfo struct {
2398 // I contains the input expression to be parsed.

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected