1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

extract full matcher group

This commit is contained in:
Darien Raymond
2018-08-20 09:57:06 +02:00
parent 899b1399ee
commit 44c759eeab
5 changed files with 91 additions and 9 deletions

View File

@@ -21,6 +21,19 @@ func BenchmarkDomainMatcherGroup(b *testing.B) {
}
}
func BenchmarkFullMatcherGroup(b *testing.B) {
g := new(FullMatcherGroup)
for i := 1; i <= 1024; i++ {
g.Add(strconv.Itoa(i)+".v2ray.com", uint32(i))
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = g.Match("0.v2ray.com")
}
}
func BenchmarkMarchGroup(b *testing.B) {
g := NewMatcherGroup()
for i := 1; i <= 1024; i++ {