• Mikio Hara's avatar
    net: fix slow network interface manipulations · 322214cf
    Mikio Hara authored
    This CL reduces unnecessary network facility lookups introduced
    by recent changes below.
    
    changeset: 15798:53a4da6a4f4a
    net: return correct point-to-point interface address on linux
    
    changeset: 15799:a81ef8e0cc05
    net: set up IPv6 scoped addressing zone for network facilities
    
    Also adds a test case for issue	4839.
    
    Benchmark results on linux/amd64, virtual machine:
    benchmark                                 old ns/op    new ns/op    delta
    BenchmarkInterfaces-2                         80487        80382   -0.13%
    BenchmarkInterfaceByIndex-2                   72013        71391   -0.86%
    BenchmarkInterfaceByName-2                    79865        80101   +0.30%
    BenchmarkInterfaceAddrs-2                     42071       829677  +1872.09%
    BenchmarkInterfacesAndAddrs-2                 35016       607622  +1635.27%
    BenchmarkInterfacesAndMulticastAddrs-2       169849       169082   -0.45%
    old: 15797:9c3930413c1b, new: tip
    
    Benchmark results on linux/amd64, virtual machine:...
    322214cf
interface_openbsd.go 392 Bytes