Descriptionarchive/tar: reuse temporary buffer in writeHeader
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.
Patch Set 1 #Patch Set 2 : diff -r 363e78454ccd https://code.google.com/p/go/ #Patch Set 3 : diff -r 363e78454ccd https://code.google.com/p/go/ #
Total comments: 4
Patch Set 4 : diff -r 363e78454ccd https://code.google.com/p/go/ #MessagesTotal messages: 7
|