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

Function BenchmarkParseParallel

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

Source from the content-addressed store, hash-verified

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

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