diff options
| author | Cristian Staretu <unclejacksons@gmail.com> | 2014-07-03 09:40:53 +1000 |
|---|---|---|
| committer | David Symonds <dsymonds@golang.org> | 2014-07-03 09:40:53 +1000 |
| commit | fe5a358aaeb7e582b763125c1e05e601ccad3b63 (patch) | |
| tree | 51ffa6d8c588edfd15d74c8bfbbec5689a009ebe /src/pkg/runtime/runtime.h | |
| parent | 372f399e00693b1d49bc1243feb66f2c9bf0dd5c (diff) | |
| download | go-fe5a358aaeb7e582b763125c1e05e601ccad3b63.tar.xz | |
archive/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.
LGTM=dsymonds
R=golang-codereviews, dave, dsymonds
CC=golang-codereviews
https://golang.org/cl/107440043
Diffstat (limited to 'src/pkg/runtime/runtime.h')
0 files changed, 0 insertions, 0 deletions
