Merge branch 'dns' into dns-geo

This commit is contained in:
秋のかえで
2021-05-01 08:48:29 +08:00
12 changed files with 910 additions and 48 deletions

View File

@@ -8,6 +8,19 @@ import (
. "github.com/xtls/xray-core/common/matcher/str"
)
func BenchmarkACAutomaton(b *testing.B) {
ac := NewACAutomaton()
for i := 1; i <= 1024; i++ {
ac.Add(strconv.Itoa(i)+".v2ray.com", Domain)
}
ac.Build()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = ac.Match("0.v2ray.com")
}
}
func BenchmarkDomainMatcherGroup(b *testing.B) {
g := new(DomainMatcherGroup)