mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-14 15:40:24 +08:00
改进WAF缓存性能
This commit is contained in:
@@ -41,6 +41,7 @@ func TestMatchRemoteCache(t *testing.T) {
|
||||
func BenchmarkMatchStringCache(b *testing.B) {
|
||||
data := strings.Repeat("HELLO", 512)
|
||||
regex := regexp.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
|
||||
_ = MatchStringCache(regex, data)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = MatchStringCache(regex, data)
|
||||
|
||||
Reference in New Issue
Block a user