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

Function BenchmarkInterpreter

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

Source from the content-addressed store, hash-verified

1878}
1879
1880func BenchmarkInterpreter(b *testing.B) {
1881 for _, tst := range testData(b) {
1882 if tst.err != "" || tst.progErr != "" {
1883 continue
1884 }
1885 prg, frame, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))
1886 if err != nil {
1887 b.Fatal(err)
1888 }
1889 // Benchmark the eval.
1890 b.Run(tst.name, func(b *testing.B) {
1891 b.ResetTimer()
1892 b.ReportAllocs()
1893 for i := 0; i < b.N; i++ {
1894 prg.Exec(frame)
1895 }
1896 })
1897 }
1898}
1899
1900func BenchmarkInterpreterParallel(b *testing.B) {
1901 for _, tst := range testData(b) {

Callers

nothing calls this directly

Calls 5

testDataFunction · 0.85
programFunction · 0.85
OptimizeFunction · 0.85
CompileRegexConstantsFunction · 0.85
ExecMethod · 0.65

Tested by

no test coverage detected