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

Function BenchmarkParseParallel

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

Source from the content-addressed store, hash-verified

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