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

Function BenchmarkParse

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

Source from the content-addressed store, hash-verified

3599}
3600
3601func BenchmarkParse(b *testing.B) {
3602 p, err := NewParser(
3603 Macros(AllMacros...),
3604 MaxRecursionDepth(32),
3605 ErrorRecoveryLimit(4),
3606 ErrorRecoveryLookaheadTokenLimit(4),
3607 PopulateMacroCalls(true),
3608 )
3609 if err != nil {
3610 b.Fatal(err)
3611 }
3612 b.ResetTimer()
3613 for n := 0; n < b.N; n++ {
3614 for _, testCase := range testCases {
3615 p.Parse(common.NewTextSource(testCase.I))
3616 }
3617 }
3618}
3619
3620func BenchmarkParseParallel(b *testing.B) {
3621 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