(b *testing.B)
| 196 | } |
| 197 | |
| 198 | func BenchmarkRuleSet_MatchRequest_Regexp2(b *testing.B) { |
| 199 | reg, err := regexp.Compile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`) |
| 200 | if err != nil { |
| 201 | b.Fatal(err) |
| 202 | } |
| 203 | |
| 204 | buf := bytes.Repeat([]byte(" HELLO "), 10240) |
| 205 | |
| 206 | for i := 0; i < b.N; i++ { |
| 207 | _ = reg.Match(buf) |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | func BenchmarkRuleSet_MatchRequest_Regexp3(b *testing.B) { |
| 212 | reg, err := regexp.Compile(`(?iU)^(eval|system|exec|execute|passthru|shell_exec|phpinfo)`) |