Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Issue 2014243002: WIP: Archive command which is much faster (Closed)

Created:
4 years, 7 months ago by mithro
Modified:
3 years, 10 months ago
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel
Base URL:
https://github.com/luci/luci-go@master
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

WIP: Archive command which is much faster * Uploads small files inside an ar archive. * Uses a better file system walking method. * Keeps all reads linear. * Uses a more efficient pipelining system. * Doesn't do expensive stat calls. BUG=598990

Patch Set 1 #

Patch Set 2 : Small fixes. #

Patch Set 3 : Lots of reworking. #

Patch Set 4 : Fixes. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+1210 lines, -7 lines) Patch
A client/cmd/isolate/fastarchive.go View 1 2 3 1 chunk +316 lines, -0 lines 7 comments Download
M client/cmd/isolate/main.go View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
A common/archive/ar/ar_test.go View 1 2 3 1 chunk +185 lines, -0 lines 0 comments Download
A common/archive/ar/doc.go View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
A common/archive/ar/reader.go View 1 2 3 1 chunk +274 lines, -0 lines 0 comments Download
A common/archive/ar/writer.go View 1 2 3 1 chunk +221 lines, -0 lines 0 comments Download
A + common/archive/doc.go View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
A + common/dirtools/doc.go View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
A common/dirtools/walker.go View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A common/dirtools/walknostat.go View 1 2 3 1 chunk +128 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
tandrii_google
is it correct, that with this CL, if I am archiving two smallish files inside ...
4 years, 6 months ago (2016-06-06 08:37:52 UTC) #2
mithro
On 2016/06/06 at 08:37:52, tandrii wrote: > is it correct, that with this CL, if ...
4 years, 6 months ago (2016-06-06 16:33:29 UTC) #3
mithro
On 2016/06/06 at 16:33:29, mithro wrote: > On 2016/06/06 at 08:37:52, tandrii wrote: > > ...
4 years, 6 months ago (2016-06-06 16:38:33 UTC) #4
M-A Ruel
4 years, 6 months ago (2016-06-08 20:52:36 UTC) #6
skipping ar and dirtools

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
File client/cmd/isolate/fastarchive.go (right):

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:18: //"github.com/luci/luci-go/client/isolate"
please trim comments

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:34: type ToHash struct {
these do not need to be exported

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:62: const CHECK_BATCH_SIZE = 20
I prefer const to be at the top for consistency, it's not a hard requirement

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:64: func ChckFile(is
isolatedclient.IsolateServer, canceler common.Canceler, src <-chan *ToCheck, dst
chan<- *ToPush) {
Check?

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:119: close(dst)
don't close a channel handed in, have the caller close it.

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:224: done_chan := make(chan bool)
technically, you want a sync.WaitGroup so in each function, you'd do defer
wg.Done() and do a wg.Wait() at the end

https://codereview.chromium.org/2014243002/diff/60001/client/cmd/isolate/fast...
client/cmd/isolate/fastarchive.go:228: go HashFile(is, canceler, hash_chan,
chck_chan)
- these do not need to be exported
- I prefer the close() call to be here, not inside the function. This makes the
code here more clunky but on the other hand ownership is clear, e.g.

go func() {
  defer close(chk_chan)
  defer wg.Done()
  hashFile(is, canceler, hash_chan, chk_chan)
}()


- mind using a stageNfooBar form, with N being the stage number? It makes
scanning the functions easier to relate to the logical ordering.

Powered by Google App Engine
This is Rietveld 408576698