(b *testing.B)
| 57 | } |
| 58 | |
| 59 | func BenchmarkMatchStringCache(b *testing.B) { |
| 60 | runtime.GOMAXPROCS(1) |
| 61 | |
| 62 | var data = strings.Repeat("HELLO", 128) |
| 63 | var regex = re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`) |
| 64 | //b.Log(regex.Keywords()) |
| 65 | _ = utils.MatchStringCache(regex, data, utils.CacheShortLife) |
| 66 | |
| 67 | for i := 0; i < b.N; i++ { |
| 68 | _ = utils.MatchStringCache(regex, data, utils.CacheShortLife) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | func BenchmarkMatchStringCache_LowHit(b *testing.B) { |
| 73 | runtime.GOMAXPROCS(1) |
nothing calls this directly
no test coverage detected