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

Issue 3135014: Add --jobs support to gclient. --jobs=1 is still the default for now. (Closed)

Created:
10 years, 4 months ago by M-A Ruel
Modified:
9 years, 7 months ago
Reviewers:
bradnelson, bradn, piman
CC:
chromium-reviews, Nicolas Sylvain, M-A Ruel
Visibility:
Public.

Description

Add --jobs support to gclient. --jobs=1 is still the default for now. Huge thanks to piman@ for working on a patch. I chose a different design but he gave me motivation and ideas. Sorry for not accepting his patch earlier, this was mostly due to broken gclient implementation itself. gclient can now run an unlimited number of parallel checkouts and always keep the checkout coherency correct. --jobs=1 is single threaded as before, albeit with a different code path. Issues: - Using --jobs with a value other than 1 will result in a mangled output. - Exceptions thrown in a thread will be have the wrong stack trace. TEST=gclient sync -j 99 in a ssh:// chromiumos checkout is dramatically faster. --- Here's the perf on linux on i7-860 for a chromium checkout with warm cache. Cold cache will result is significantly reduced improvements so this is best case improvements. The sync was no-op all the time except where noted. All execution where with "time gclient sync " + args. Didn't include 'sys' column since it was statistically insignifiant and highly correlated with 'user'. runs with -f runs with -m without -f nor -m args real user real user real user -j 12 20.59s 18.00s 5.64s 7.95s 5.86s 8.10s #1 1m05.26s 20.02s 5.20s 7.94s 5.10s 8.09s 22.79s 18.17s -j 1 #2 1m47.00s 16.72s 9.69s 5.72s 12.35s 5.96s 1m31.28s 17.06s 9.54s 5.85s 10.51s 6.20s 1m31.79s 16.39s before #3 1m30.94s 16.74s 9.77s 5.83s 10.45s 5.77s 1m30.17s 17.30s 10.36s 5.68s 10.16s 5.88s hook #4 8.52s 7.93s 8.73s 8.13s #1 This particular run synched to r56023, a webkit roll updating layout tests. It's still faster than a no-op sync without parallel checkout. #2 Maybe there was a sync or computer hickup, I didn't realize. #3 This is depot_tools@56020 #4 Since -f implies runhooks, I ran the hook 'python src/build/gyp_chromium' manually to compare. Hooks are still run in a single thread. I didn't rest 'gclient runhooks'. I tried to go a ssh:// checkout of chromium os tree but it timed out everytime I tried to sync so I couldn't get data points. I expect an order of magnitude of improvement or more. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=56079

Patch Set 1 #

Patch Set 2 : fix mutating bug #

Total comments: 7

Patch Set 3 : Make self.running more coherent, renamed self.cond, added comments #

Total comments: 3

Patch Set 4 : No need to make the thread a daemon #

Patch Set 5 : Add polling for Ctrl-C support #

Patch Set 6 : As long as timeout is specified, it doesn't need to be a low value #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -66 lines) Patch
M gclient.py View 1 6 chunks +10 lines, -4 lines 0 comments Download
M gclient_utils.py View 1 2 3 4 5 3 chunks +100 lines, -62 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
M-A Ruel
I kept the default to 1 the time I fine tune the default a bit. ...
10 years, 4 months ago (2010-08-13 16:41:52 UTC) #1
M-A Ruel
Fixed the description (lines starting with # were ignored) and fixed the mutation bug while ...
10 years, 4 months ago (2010-08-13 16:54:08 UTC) #2
M-A Ruel
And for the record: runs with -f runs with -m without -f nor -m args ...
10 years, 4 months ago (2010-08-13 16:56:18 UTC) #3
bradn
Generally looks ok. I'd have spawned a fixed number of workers and had then drain ...
10 years, 4 months ago (2010-08-13 17:23:25 UTC) #4
M-A Ruel
On 2010/08/13 17:23:25, bradn wrote: > Generally looks ok. > I'd have spawned a fixed ...
10 years, 4 months ago (2010-08-13 19:21:13 UTC) #5
piman
http://codereview.chromium.org/3135014/diff/3001/4002 File gclient_utils.py (right): http://codereview.chromium.org/3135014/diff/3001/4002#newcode462 gclient_utils.py:462: self.cond.wait() Does ctrl-c work ? In my previous CL ...
10 years, 4 months ago (2010-08-13 19:26:06 UTC) #6
bradn
I'm not completely sure the thread pool would be a micro optimization. In particular, would ...
10 years, 4 months ago (2010-08-13 19:29:14 UTC) #7
piman
On Fri, Aug 13, 2010 at 12:29 PM, <bradnelson@google.com> wrote: > I'm not completely sure ...
10 years, 4 months ago (2010-08-13 19:31:35 UTC) #8
bradn
Ah yes, I see, it breaks and the waits, cool, ok.
10 years, 4 months ago (2010-08-13 19:36:00 UTC) #9
M-A Ruel
Add polling so Ctrl-C still work. (Sadness) Note that I set it to 10 seconds ...
10 years, 4 months ago (2010-08-13 19:55:57 UTC) #10
piman
http://codereview.chromium.org/3135014/diff/9001/10002 File gclient_utils.py (right): http://codereview.chromium.org/3135014/diff/9001/10002#newcode486 gclient_utils.py:486: self.daemon = True I think you want to keep ...
10 years, 4 months ago (2010-08-13 20:12:10 UTC) #11
M-A Ruel
http://codereview.chromium.org/3135014/diff/9001/10002 File gclient_utils.py (right): http://codereview.chromium.org/3135014/diff/9001/10002#newcode486 gclient_utils.py:486: self.daemon = True On 2010/08/13 20:12:10, piman wrote: > ...
10 years, 4 months ago (2010-08-13 20:23:20 UTC) #12
piman
10 years, 4 months ago (2010-08-13 20:31:32 UTC) #13
On Fri, Aug 13, 2010 at 1:23 PM, <maruel@chromium.org> wrote:

>
> http://codereview.chromium.org/3135014/diff/9001/10002
> File gclient_utils.py (right):
>
> http://codereview.chromium.org/3135014/diff/9001/10002#newcode486
> gclient_utils.py:486: self.daemon = True
> On 2010/08/13 20:12:10, piman wrote:
>
>> I think you want to keep the threads as daemons. Otherwise, if the
>>
> main thread
>
>> dies, ctrl-c can't kill the threads (it will cause the supbrocess to
>>
> quit, but
>
>> not the thread itself).
>>
>
> Since the threads never wait while holding the lock, they will quit in a
> timely manner all the time so I'd prefer to not make them daemon. In my
> limited testing it wasn't an issue at least.


Fair enough, LGTM.

>
>
> http://codereview.chromium.org/3135014/show
>

Powered by Google App Engine
This is Rietveld 408576698