• Cristian Staretu's avatar
    archive/tar: reuse temporary buffer in writeHeader · fe5a358a
    Cristian Staretu authored
    A temporary 512 bytes buffer is allocated for every call to
    writeHeader. This buffer could be reused the lower the number
    of memory allocations.
    
    benchmark                   old ns/op     new ns/op     delta
    BenchmarkWriteFiles100k     634622051     583810847     -8.01%
    
    benchmark                   old allocs     new allocs     delta
    BenchmarkWriteFiles100k     2701920        2602621        -3.68%
    
    benchmark                   old bytes     new bytes     delta
    BenchmarkWriteFiles100k     115383884     64349922      -44.23%
    
    This change is very important if your code has to write a lot of
    tarballs with a lot of files.
    
    LGTM=dsymonds
    R=golang-codereviews, dave, dsymonds
    CC=golang-codereviews
    https://golang.org/cl/107440043
    fe5a358a
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...