MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / BenchmarkRuleSet_MatchRequest_Regexp2

Function BenchmarkRuleSet_MatchRequest_Regexp2

internal/waf/rule_set_test.go:198–209  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

196}
197
198func 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
211func BenchmarkRuleSet_MatchRequest_Regexp3(b *testing.B) {
212 reg, err := regexp.Compile(`(?iU)^(eval|system|exec|execute|passthru|shell_exec|phpinfo)`)

Callers

nothing calls this directly

Calls 1

MatchMethod · 0.45

Tested by

no test coverage detected