(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestMatchBytesCache_WithoutCache(t *testing.T) { |
| 52 | data := []byte(strings.Repeat("HELLO", 512)) |
| 53 | regex := regexp.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`) |
| 54 | before := time.Now() |
| 55 | t.Log(regex.Match(data)) |
| 56 | t.Log(time.Since(before).Seconds()*1000, "ms") |
| 57 | } |
| 58 | |
| 59 | func BenchmarkMatchStringCache(b *testing.B) { |
| 60 | runtime.GOMAXPROCS(1) |