(b *testing.B)
| 70 | } |
| 71 | |
| 72 | func BenchmarkMatchStringCache_LowHit(b *testing.B) { |
| 73 | runtime.GOMAXPROCS(1) |
| 74 | |
| 75 | var regex = re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`) |
| 76 | //b.Log(regex.Keywords()) |
| 77 | |
| 78 | for i := 0; i < b.N; i++ { |
| 79 | var data = strings.Repeat("A", rands.Int(0, 100)) |
| 80 | _ = utils.MatchStringCache(regex, data, utils.CacheShortLife) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | func BenchmarkMatchStringCache_WithoutCache(b *testing.B) { |
| 85 | runtime.GOMAXPROCS(1) |
nothing calls this directly
no test coverage detected