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

Function BenchmarkInterpreterParallel

interpreter/interpreter_test.go:1713–1732  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1711}
1712
1713func BenchmarkInterpreterParallel(b *testing.B) {
1714 for _, tst := range testData(b) {
1715 prg, vars, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))
1716 if tst.err != "" || tst.progErr != "" {
1717 continue
1718 }
1719 if err != nil {
1720 b.Fatal(err)
1721 }
1722 b.ResetTimer()
1723 b.Run(tst.name,
1724 func(b *testing.B) {
1725 b.RunParallel(func(pb *testing.PB) {
1726 for pb.Next() {
1727 prg.Eval(vars)
1728 }
1729 })
1730 })
1731 }
1732}
1733
1734func TestInterpreter(t *testing.T) {
1735 for _, tst := range testData(t) {

Callers

nothing calls this directly

Calls 6

testDataFunction · 0.85
programFunction · 0.85
OptimizeFunction · 0.85
CompileRegexConstantsFunction · 0.85
NextMethod · 0.65
EvalMethod · 0.65

Tested by

no test coverage detected