Add domain unpacking benchmark

This commit is contained in:
Alex Ciuba 2014-01-31 14:46:12 -05:00
parent 16d6ebe1c1
commit 008c1d5916
1 changed files with 10 additions and 0 deletions

View File

@ -330,6 +330,16 @@ func BenchmarkPackDomainName(b *testing.B) {
}
}
func BenchmarkUnpackDomainName(b *testing.B) {
name1 := "12345678901234567890123456789012345.12345678.123."
buf := make([]byte, len(name1)+1)
_, _ = PackDomainName(name1, buf, 0, nil, false)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _, _ = UnpackDomainName(buf, 0)
}
}
func TestToRFC3597(t *testing.T) {
a, _ := NewRR("miek.nl. IN A 10.0.1.1")
x := new(RFC3597)