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

Issue 107440043: code review 107440043: archive/tar: reuse temporary buffer in writeHeader (Closed)

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

Description

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.

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/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -3 lines) Patch
M src/pkg/archive/tar/writer.go View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 7
unclejack
Hello golang-codereviews@googlegroups.com, dave@cheney.net, dsymonds@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 10 months ago (2014-07-02 09:01:38 UTC) #1
dave_cheney.net
https://codereview.appspot.com/107440043/diff/40001/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): https://codereview.appspot.com/107440043/diff/40001/src/pkg/archive/tar/writer.go#newcode165 src/pkg/archive/tar/writer.go:165: copy(tw.hdrBuff[:], zeroBlock) copy(header, zeroBlock) https://codereview.appspot.com/107440043/diff/40001/src/pkg/archive/tar/writer.go#newcode166 src/pkg/archive/tar/writer.go:166: s := slicer(header) ...
9 years, 10 months ago (2014-07-02 10:11:22 UTC) #2
unclejack
dfc, I've updated both CLs. https://codereview.appspot.com/107440043/diff/40001/src/pkg/archive/tar/writer.go File src/pkg/archive/tar/writer.go (right): https://codereview.appspot.com/107440043/diff/40001/src/pkg/archive/tar/writer.go#newcode165 src/pkg/archive/tar/writer.go:165: copy(tw.hdrBuff[:], zeroBlock) On 2014/07/02 ...
9 years, 10 months ago (2014-07-02 11:58:38 UTC) #3
dsymonds
LGTM
9 years, 10 months ago (2014-07-02 23:39:07 UTC) #4
dsymonds
The codereview plugin barfed while I was submitting this. It did get submitted (https://code.google.com/p/go/source/detail?r=837348e418f33fc7a242f56dbe2feff829532526), but ...
9 years, 10 months ago (2014-07-02 23:44:27 UTC) #5
gobot
R=close (assigned by dave@cheney.net)
9 years, 10 months ago (2014-07-03 10:02:50 UTC) #6
unclejack
9 years, 10 months ago (2014-07-08 12:02:27 UTC) #7
*** Abandoned ***
Sign in to reply to this message.

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