Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: (Interface).Addrs() slowdown #4866

Closed
gpaul opened this issue Feb 21, 2013 · 4 comments

Comments

Projects
None yet
5 participants
@gpaul
Copy link
Contributor

commented Feb 21, 2013

I saw a pretty significant slowdown of (Interface).Addrs() after

changeset:   15316:53a4da6a4f4a
user:        Mikio Hara <mikioh.mikioh@gmail.com>
date:        Wed Feb 20 07:31:44 2013 +0900
summary:     net: return correct point-to-point interface address on linux

benchmark         old ns/op    new ns/op    delta
BenchmarkAddrs        55663     92844026  +166696.66%

go version: tip
environment: (Fedora 16) Linux me 3.4.7-1.fc16.x86_64 #1 SMP Mon Jul 30 16:37:23 UTC
2012 x86_64 x86_64 x86_64 GNU/Linux

To run the benchmark, clpatch CL 7385048 then run

# go test -c -i net
# ./net.test -test.run=NONE -test.bench=Addrs -test.cpuprofile cpu.out
# go tool pprof net.test cpu.out

Total: 188 samples
     187  99.5%  99.5%      187  99.5% syscall.Syscall6
       1   0.5% 100.0%        1   0.5% runtime.settype
       0   0.0% 100.0%        1   0.5% growslice1
       0   0.0% 100.0%        1   0.5% makeslice1
       0   0.0% 100.0%      187  99.5% net.(*Interface).Addrs
       0   0.0% 100.0%      188 100.0% net.BenchmarkInterfaceAddrs
       0   0.0% 100.0%      187  99.5% net.InterfaceByIndex
       0   0.0% 100.0%        1   0.5% net.Interfaces
       0   0.0% 100.0%      187  99.5% net.addrTable
       0   0.0% 100.0%      187  99.5% net.interfaceAddrTable
       0   0.0% 100.0%      188 100.0% net.interfaceTable
       0   0.0% 100.0%        1   0.5% runtime.growslice
       0   0.0% 100.0%      188 100.0% schedunlock
       0   0.0% 100.0%      188 100.0% syscall.NetlinkRIB
       0   0.0% 100.0%        1   0.5% syscall.ParseNetlinkMessage
       0   0.0% 100.0%        2   1.1% syscall.Recvfrom
       0   0.0% 100.0%      185  98.4% syscall.Sendto
       0   0.0% 100.0%        2   1.1% syscall.recvfrom
       0   0.0% 100.0%      185  98.4% syscall.sendto
       0   0.0% 100.0%      188 100.0% testing.(*B).launch
       0   0.0% 100.0%      188 100.0% testing.(*B).runN
@remyoudompheng

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2013

Comment 1:

You may want to try https://golang.org/cl/7403045
and report the results.
@gpaul

This comment has been minimized.

Copy link
Contributor Author

commented Feb 21, 2013

Comment 2:

Thanks, that's quite a bit better but still quite slow. 
benchmark                    old ns/op    new ns/op    delta
BenchmarkInterfaceAddrs-3     94722139      3843655  -95.94%
Mikio says he's working on it.
@mikioh

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2013

Comment 3:

https://golang.org/cl/7384048/

Status changed to Started.

@mikioh

This comment has been minimized.

Copy link
Contributor

commented Feb 28, 2013

Comment 4:

This issue was closed by revision 322214c.

Status changed to Fixed.

@gpaul gpaul added fixed labels Feb 28, 2013

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015

@rsc rsc removed the go1.1maybe label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.