• Cristian Staretu's avatar
    syscall: NetlinkRIB, avoid allocation in loop · 8aea9a00
    Cristian Staretu authored
    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.
    
    LGTM=crawshaw, dave
    R=dave, dsymonds, crawshaw
    CC=bradfitz, dsymonds, golang-codereviews
    https://golang.org/cl/110920043
    8aea9a00
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...