(b *testing.B)
| 1878 | } |
| 1879 | |
| 1880 | func 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 | |
| 1900 | func BenchmarkInterpreterParallel(b *testing.B) { |
| 1901 | for _, tst := range testData(b) { |
nothing calls this directly
no test coverage detected