Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1925)

Issue 7400055: code review 7400055: net: fix slow network interface manipulations (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by mikio
Modified:
11 years, 2 months ago
Reviewers:
CC:
golang-dev, albert.strasheim
Visibility:
Public.

Description

net: fix slow network interface manipulations 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: benchmark old ns/op new ns/op delta BenchmarkInterfaces-2 80487 81459 +1.21% BenchmarkInterfaceByIndex-2 72013 71512 -0.70% BenchmarkInterfaceByName-2 79865 80567 +0.88% BenchmarkInterfaceAddrs-2 42071 120108 +185.49% BenchmarkInterfacesAndAddrs-2 35016 33259 -5.02% BenchmarkInterfacesAndMulticastAddrs-2 169849 82391 -51.49% old: 15797:9c3930413c1b, new: tip+CL7400055 Benchmark results on darwin/amd64: benchmark old ns/op new ns/op delta BenchmarkInterfaces-2 34402 34231 -0.50% BenchmarkInterfaceByIndex-2 13192 12956 -1.79% BenchmarkInterfaceByName-2 34791 34388 -1.16% BenchmarkInterfaceAddrs-2 36565 63906 +74.77% BenchmarkInterfacesAndAddrs-2 17497 31068 +77.56% BenchmarkInterfacesAndMulticastAddrs-2 25276 66711 +163.93% old: 15797:9c3930413c1b, new: tip Benchmark results on darwin/amd64: benchmark old ns/op new ns/op delta BenchmarkInterfaces-2 34402 31854 -7.41% BenchmarkInterfaceByIndex-2 13192 12950 -1.83% BenchmarkInterfaceByName-2 34791 31926 -8.23% BenchmarkInterfaceAddrs-2 36565 42144 +15.26% BenchmarkInterfacesAndAddrs-2 17497 17329 -0.96% BenchmarkInterfacesAndMulticastAddrs-2 25276 24870 -1.61% old: 15797:9c3930413c1b, new: tip+CL7400055 Update issue 4234. Fixes issue 4839 (again). Fixes issue 4866.

Patch Set 1 #

Patch Set 2 : diff -r f002e89cbd51 https://code.google.com/p/go #

Patch Set 3 : diff -r 7a706e0f5d51 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+366 lines, -121 lines) Patch
M src/pkg/net/interface.go View 1 2 5 chunks +10 lines, -6 lines 0 comments Download
M src/pkg/net/interface_bsd.go View 1 2 8 chunks +39 lines, -17 lines 0 comments Download
A src/pkg/net/interface_bsd_test.go View 1 1 chunk +50 lines, -0 lines 0 comments Download
M src/pkg/net/interface_darwin.go View 1 5 chunks +8 lines, -11 lines 0 comments Download
M src/pkg/net/interface_freebsd.go View 1 5 chunks +8 lines, -11 lines 0 comments Download
M src/pkg/net/interface_linux.go View 1 2 5 chunks +41 lines, -40 lines 0 comments Download
M src/pkg/net/interface_linux_test.go View 1 1 chunk +47 lines, -1 line 0 comments Download
M src/pkg/net/interface_netbsd.go View 1 1 chunk +3 lines, -6 lines 0 comments Download
M src/pkg/net/interface_openbsd.go View 1 1 chunk +3 lines, -6 lines 0 comments Download
M src/pkg/net/interface_stub.go View 1 2 chunks +7 lines, -10 lines 0 comments Download
A src/pkg/net/interface_unix_test.go View 1 2 1 chunk +141 lines, -0 lines 0 comments Download
M src/pkg/net/interface_windows.go View 1 4 chunks +9 lines, -13 lines 0 comments Download

Messages

Total messages: 9
mikio
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 2 months ago (2013-02-27 05:29:29 UTC) #1
albert.strasheim
Some interesting stuff going on... old: tip, new: tip+CL7400055 BenchmarkInterfaces-8 4380009 4936148 +12.70% BenchmarkInterfaceByIndex-8 4529097 ...
11 years, 2 months ago (2013-02-27 07:10:22 UTC) #2
mikio
On Wed, Feb 27, 2013 at 4:10 PM, <fullung@gmail.com> wrote: > This is a pretty ...
11 years, 2 months ago (2013-02-27 07:38:20 UTC) #3
albert.strasheim
Hello On 2013/02/27 07:38:20, mikio wrote: > On Wed, Feb 27, 2013 at 4:10 PM, ...
11 years, 2 months ago (2013-02-27 08:44:31 UTC) #4
mikio
On Wed, Feb 27, 2013 at 4:38 PM, Mikio Hara <mikioh.mikioh@gmail.com> wrote: >> Maybe you ...
11 years, 2 months ago (2013-02-27 08:45:56 UTC) #5
albert.strasheim
Hello On 2013/02/27 08:45:56, mikio wrote: > On Wed, Feb 27, 2013 at 4:38 PM, ...
11 years, 2 months ago (2013-02-27 08:47:55 UTC) #6
mikio
On Wed, Feb 27, 2013 at 5:44 PM, <fullung@gmail.com> wrote: > Do I understand correctly ...
11 years, 2 months ago (2013-02-28 01:31:51 UTC) #7
mikio
> I think it fixes it and this CL is as fast as it can ...
11 years, 2 months ago (2013-02-28 01:33:40 UTC) #8
mikio
11 years, 2 months ago (2013-02-28 05:58:50 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=0b4084d8be42 ***

net: fix slow network interface manipulations

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:
benchmark                                 old ns/op    new ns/op    delta
BenchmarkInterfaces-2                         80487        81459   +1.21%
BenchmarkInterfaceByIndex-2                   72013        71512   -0.70%
BenchmarkInterfaceByName-2                    79865        80567   +0.88%
BenchmarkInterfaceAddrs-2                     42071       120108  +185.49%
BenchmarkInterfacesAndAddrs-2                 35016        33259   -5.02%
BenchmarkInterfacesAndMulticastAddrs-2       169849        82391  -51.49%
old: 15797:9c3930413c1b, new: tip+CL7400055

Benchmark results on darwin/amd64:
benchmark                                 old ns/op    new ns/op    delta
BenchmarkInterfaces-2                         34402        34231   -0.50%
BenchmarkInterfaceByIndex-2                   13192        12956   -1.79%
BenchmarkInterfaceByName-2                    34791        34388   -1.16%
BenchmarkInterfaceAddrs-2                     36565        63906  +74.77%
BenchmarkInterfacesAndAddrs-2                 17497        31068  +77.56%
BenchmarkInterfacesAndMulticastAddrs-2        25276        66711  +163.93%
old: 15797:9c3930413c1b, new: tip

Benchmark results on darwin/amd64:
benchmark                                 old ns/op    new ns/op    delta
BenchmarkInterfaces-2                         34402        31854   -7.41%
BenchmarkInterfaceByIndex-2                   13192        12950   -1.83%
BenchmarkInterfaceByName-2                    34791        31926   -8.23%
BenchmarkInterfaceAddrs-2                     36565        42144  +15.26%
BenchmarkInterfacesAndAddrs-2                 17497        17329   -0.96%
BenchmarkInterfacesAndMulticastAddrs-2        25276        24870   -1.61%
old: 15797:9c3930413c1b, new: tip+CL7400055

Update issue 4234.
Fixes issue 4839 (again).
Fixes issue 4866.

R=golang-dev, fullung
CC=golang-dev
https://codereview.appspot.com/7400055
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b