• Matthew Dempsky's avatar
    net: append ":53" to DNS servers when reading resolv.conf · 4d9bda51
    Matthew Dempsky authored
    Avoids generating some redundant garbage from re-concatenating the
    same string for every DNS query.
    
    benchmark                                      old allocs     new allocs     delta
    BenchmarkGoLookupIP-32                         156            154            -1.28%
    BenchmarkGoLookupIPNoSuchHost-32               456            446            -2.19%
    BenchmarkGoLookupIPWithBrokenNameServer-32     577            564            -2.25%
    
    benchmark                                      old bytes     new bytes     delta
    BenchmarkGoLookupIP-32                         10873         10824         -0.45%
    BenchmarkGoLookupIPNoSuchHost-32               43303         43140         -0.38%
    BenchmarkGoLookupIPWithBrokenNameServer-32     46824         46616         -0.44%
    
    Update #15473.
    
    Change-Id: I3b0173dfedf31bd08eaea1069968b416850864a1
    Reviewed-on: https://go-review.googlesource.com/22556Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    4d9bda51
dnsclient_unix_test.go 16.5 KB