(b *testing.B)
| 1029 | } |
| 1030 | |
| 1031 | func BenchmarkNewState(b *testing.B) { |
| 1032 | f, _ := newFilter(LuaOptions{}, `function request(ctx, params) end`) |
| 1033 | s := f.(*script) |
| 1034 | |
| 1035 | b.ResetTimer() |
| 1036 | for i := 0; i < b.N; i++ { |
| 1037 | s.newState() |
| 1038 | } |
| 1039 | } |
| 1040 | |
| 1041 | func benchmarkRequest(b *testing.B, script string, params ...string) { |
| 1042 | f, _ := newFilter(LuaOptions{}, script, params...) |