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

Function BenchmarkParseParallel

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

Source from the content-addressed store, hash-verified

3618}
3619
3620func BenchmarkParseParallel(b *testing.B) {
3621 p, err := NewParser(
3622 Macros(AllMacros...),
3623 MaxRecursionDepth(32),
3624 ErrorRecoveryLimit(4),
3625 ErrorRecoveryLookaheadTokenLimit(4),
3626 PopulateMacroCalls(true),
3627 )
3628 if err != nil {
3629 b.Fatal(err)
3630 }
3631 b.ResetTimer()
3632 b.RunParallel(func(pb *testing.PB) {
3633 for pb.Next() {
3634 for _, testCase := range testCases {
3635 p.Parse(common.NewTextSource(testCase.I))
3636 }
3637 }
3638 })
3639}
3640
3641type benchTestInfo struct {
3642 // 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