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

Function BenchmarkInterpreterParallel

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

Source from the content-addressed store, hash-verified

1918}
1919
1920func BenchmarkInterpreterParallel(b *testing.B) {
1921 for _, tst := range testData(b) {
1922 prg, vars, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))
1923 if tst.err != "" || tst.progErr != "" {
1924 continue
1925 }
1926 if err != nil {
1927 b.Fatal(err)
1928 }
1929 b.ResetTimer()
1930 b.Run(tst.name,
1931 func(b *testing.B) {
1932 b.RunParallel(func(pb *testing.PB) {
1933 for pb.Next() {
1934 prg.Eval(vars)
1935 }
1936 })
1937 })
1938 }
1939}
1940
1941func TestInterpreter(t *testing.T) {
1942 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