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

Function BenchmarkInterpreterParallel

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

Source from the content-addressed store, hash-verified

1898}
1899
1900func BenchmarkInterpreterParallel(b *testing.B) {
1901 for _, tst := range testData(b) {
1902 prg, vars, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))
1903 if tst.err != "" || tst.progErr != "" {
1904 continue
1905 }
1906 if err != nil {
1907 b.Fatal(err)
1908 }
1909 b.ResetTimer()
1910 b.Run(tst.name,
1911 func(b *testing.B) {
1912 b.RunParallel(func(pb *testing.PB) {
1913 for pb.Next() {
1914 prg.Eval(vars)
1915 }
1916 })
1917 })
1918 }
1919}
1920
1921func TestInterpreter(t *testing.T) {
1922 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