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

Issue 110920043: code review 110920043: syscall: NetlinkRIB - avoid allocation in loop (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by unclejack
Modified:
10 years, 11 months ago
Reviewers:
gobot, dave, crawshaw
CC:
dave_cheney.net, dsymonds, crawshaw, bradfitz, golang-codereviews
Visibility:
Public.

Description

syscall: NetlinkRIB - avoid allocation in loop NetlinkRIB is currently allocating a page sized slice of bytes in a for loop and it's also calling Getpagesize() in the same for loop. This CL changes NetlinkRIB to preallocate the page sized slice of bytes before reaching the for loop. This reduces memory allocations and lowers the number of calls to Getpagesize() to 1 per NetlinkRIB call. This CL reduces the allocated memory from 141.5 MB down to 52 MB in a test.

Patch Set 1 #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/pkg/syscall/netlink_linux.go View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 10
unclejack
Hello dave@cheney.net, dsymonds@golang.org (cc: bradfitz@golang.org, dsymonds@golang.org, golang-codereviews@googlegroups.com), I'd like you to review this change to ...
10 years, 11 months ago (2014-07-08 13:49:17 UTC) #1
crawshaw
I don't see your name in golang.org/CONTRIBUTORS. Please sign the individual CLA, as described in ...
10 years, 11 months ago (2014-07-08 14:56:20 UTC) #2
unclejack
bradfitz has taken care of the CLA. I've sent https://codereview.appspot.com/107440043 and https://codereview.appspot.com/108240044 before. They've been ...
10 years, 11 months ago (2014-07-08 15:20:10 UTC) #3
crawshaw
Apologies, I was looking in an old CONTRIBUTORS file. On Tue, Jul 8, 2014 at ...
10 years, 11 months ago (2014-07-08 15:22:26 UTC) #4
crawshaw
LGTM
10 years, 11 months ago (2014-07-08 15:23:35 UTC) #5
dave_cheney.net
LGTM. Submitting.
10 years, 11 months ago (2014-07-09 08:47:17 UTC) #6
dave_cheney.net
On 2014/07/09 08:47:17, dfc wrote: > LGTM. Submitting. FWIW, Getpagesize always returns a constant and ...
10 years, 11 months ago (2014-07-09 08:49:50 UTC) #7
dave_cheney.net
*** Submitted as https://code.google.com/p/go/source/detail?r=fdd2d7a9dd4c *** syscall: NetlinkRIB, avoid allocation in loop NetlinkRIB is currently allocating ...
10 years, 11 months ago (2014-07-09 08:50:53 UTC) #8
gobot
This CL appears to have broken the linux-arm-cheney-panda builder. See http://build.golang.org/log/64fd7831aa19942d31425a1552b7aa96e27c85e8
10 years, 11 months ago (2014-07-09 08:52:28 UTC) #9
dave_cheney.net
10 years, 11 months ago (2014-07-09 08:54:01 UTC) #10
# Building C bootstrap tool.
cmd/dist
./make.bash: line 132: clang: command not found
Build complete, duration 101.074219ms. Result: error: exit status 127

oops, sorry, this is an unrelated failure

On Wed, Jul 9, 2014 at 6:52 PM,  <gobot@golang.org> wrote:
> This CL appears to have broken the linux-arm-cheney-panda builder.
> See http://build.golang.org/log/64fd7831aa19942d31425a1552b7aa96e27c85e8
>
> https://codereview.appspot.com/110920043/
Sign in to reply to this message.

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