改进WAF缓存性能

This commit is contained in:
GoEdgeLab
2020-11-21 21:43:03 +08:00
parent c32959a6c8
commit 5485a5f663
11 changed files with 98 additions and 63 deletions

View File

@@ -0,0 +1,13 @@
package ttlcache
import (
"runtime"
"testing"
)
func BenchmarkHashKey(b *testing.B) {
runtime.GOMAXPROCS(1)
for i := 0; i < b.N; i++ {
HashKey([]byte("HELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLDHELLO,WORLD"))
}
}