mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 18:50:27 +08:00
实现基础的206 partial content缓存
This commit is contained in:
@@ -52,8 +52,9 @@ func TestMatchBytesCache_WithoutCache(t *testing.T) {
|
||||
func BenchmarkMatchStringCache(b *testing.B) {
|
||||
runtime.GOMAXPROCS(1)
|
||||
|
||||
data := strings.Repeat("HELLO", 512)
|
||||
regex := re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
|
||||
var data = strings.Repeat("HELLO", 512)
|
||||
var regex = re.MustCompile(`(?iU)\b(eval|system|exec|execute|passthru|shell_exec|phpinfo)\b`)
|
||||
//b.Log(regex.Keywords())
|
||||
_ = MatchStringCache(regex, data)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
||||
Reference in New Issue
Block a user