]> Cypherpunks repositories - gostls13.git/commit
net: ensure dnsConfig search list is rooted
authorMatthew Dempsky <mdempsky@google.com>
Thu, 28 Apr 2016 18:31:59 +0000 (11:31 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 28 Apr 2016 20:22:21 +0000 (20:22 +0000)
commit5fe1b35ed214a8ece13449f5788dd9f5c927379f
treeddc0be1ebfcd88f4a7cf3c1ce05e0d5fe920550f
parent4d9bda51ff91f79944a12106b77315c9414b851a
net: ensure dnsConfig search list is rooted

Avoids some extra work and string concatenation at query time.

benchmark                                      old allocs     new allocs     delta
BenchmarkGoLookupIP-32                         154            150            -2.60%
BenchmarkGoLookupIPNoSuchHost-32               446            442            -0.90%
BenchmarkGoLookupIPWithBrokenNameServer-32     564            568            +0.71%

benchmark                                      old bytes     new bytes     delta
BenchmarkGoLookupIP-32                         10824         10704         -1.11%
BenchmarkGoLookupIPNoSuchHost-32               43140         42992         -0.34%
BenchmarkGoLookupIPWithBrokenNameServer-32     46616         46680         +0.14%

BenchmarkGoLookupIPWithBrokenNameServer's regression appears to be
because it's actually only performing 1 LookupIP call, so the extra
work done parsing the DNS config file doesn't amortize as well as for
BenchmarkGoLookupIP or BenchmarkGoLOokupIPNoSuchHost, which perform
2000+ LookupIP calls per run.

Update #15473.

Change-Id: I98c8072f2f39e2f2ccd6c55e9e9bd309f5ad68f8
Reviewed-on: https://go-review.googlesource.com/22571
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/dnsclient_unix.go
src/net/dnsconfig_unix.go
src/net/dnsconfig_unix_test.go