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

Issue 10911082: Load target build files in parallel using Python multiprocessing. (Closed)

Created:
8 years, 3 months ago by dmazzoni
Modified:
8 years, 2 months ago
Reviewers:
M-A Ruel, scottmg
CC:
gyp-developer_googlegroups.com
Base URL:
http://git.chromium.org/external/gyp.git@master
Visibility:
Public.

Description

Load target build files in parallel using Python multiprocessing. This parallelizes the portion of the processing that took the largest fraction of runtime previously. There's more opportunity for parallelization elsewhere, but this seems to have the biggest impact. I did some testing to verify the output is identical, but mostly with ninja. Someone familiar with all of the generators should make sure I'm not making assumptions I shouldn't be. Also, it might make sense to keep this behind an optional flag or env var for now. Raw numbers: GYP_GENERATORS=ninja time build/gyp_chromium 1. Linux, z600, chromium src + src-internal + full WebKit: 23.14 s -> 16.04 s (30% speedup) 2. MacBook Pro, chromium src only: 36.83 s -> 27.87 (25% speedup)

Patch Set 1 #

Total comments: 12

Patch Set 2 : Avoid double copy #

Patch Set 3 : Put behind flag with env var #

Total comments: 9

Patch Set 4 : Add lock and explicit class for global state #

Total comments: 8

Patch Set 5 : Switch to docstrings, move LoadTargetBuildFileCallback inside ParallelState. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -18 lines) Patch
M pylib/gyp/__init__.py View 1 2 3 4 5 chunks +12 lines, -3 lines 0 comments Download
M pylib/gyp/input.py View 1 2 3 4 6 chunks +159 lines, -15 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
scottmg
This is great! Could you add some timing info to the description? I don't feel ...
8 years, 3 months ago (2012-09-05 18:09:32 UTC) #1
M-A Ruel
https://chromiumcodereview.appspot.com/10911082/diff/1/pylib/gyp/input.py File pylib/gyp/input.py (right): https://chromiumcodereview.appspot.com/10911082/diff/1/pylib/gyp/input.py#newcode356 pylib/gyp/input.py:356: data_keys = set(data.keys()) Why double copy? data_keys = set(data) ...
8 years, 3 months ago (2012-09-05 19:45:39 UTC) #2
dmazzoni
http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py File pylib/gyp/input.py (right): http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py#newcode356 pylib/gyp/input.py:356: data_keys = set(data.keys()) On 2012/09/05 19:45:39, Marc-Antoine Ruel wrote: ...
8 years, 3 months ago (2012-09-06 16:40:59 UTC) #3
M-A Ruel
http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py File pylib/gyp/input.py (right): http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py#newcode461 pylib/gyp/input.py:461: def LoadTargetBuildFileCallback(result): A bit of docstrings explaining the dataflows ...
8 years, 3 months ago (2012-09-06 18:02:36 UTC) #4
dmazzoni
I cleaned it up a bit and put the parallel code behind a --parallel flag ...
8 years, 3 months ago (2012-09-07 07:02:24 UTC) #5
dmazzoni
Any other comments from anyone? Now that I've made it optional/opt-in, perhaps someone could just ...
8 years, 3 months ago (2012-09-12 06:45:02 UTC) #6
M-A Ruel
http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py File pylib/gyp/input.py (right): http://codereview.chromium.org/10911082/diff/1/pylib/gyp/input.py#newcode507 pylib/gyp/input.py:507: time.sleep(0.003) On 2012/09/06 18:02:36, Marc-Antoine Ruel wrote: > You ...
8 years, 3 months ago (2012-09-18 19:42:18 UTC) #7
dmazzoni
Thanks for the great feedback. I made the global state explicit and documented, and added ...
8 years, 3 months ago (2012-09-19 21:14:52 UTC) #8
dmazzoni
Ping?
8 years, 2 months ago (2012-09-26 16:20:10 UTC) #9
scottmg
On 2012/09/26 16:20:10, Dominic Mazzoni wrote: > Ping? I just tried the patch on Windows. ...
8 years, 2 months ago (2012-09-26 18:15:40 UTC) #10
M-A Ruel
lgtm with some fixes. http://codereview.chromium.org/10911082/diff/12001/pylib/gyp/input.py File pylib/gyp/input.py (right): http://codereview.chromium.org/10911082/diff/12001/pylib/gyp/input.py#newcode447 pylib/gyp/input.py:447: # Wrapper around LoadTargetBuildFile used ...
8 years, 2 months ago (2012-09-27 00:41:31 UTC) #11
dmazzoni
http://codereview.chromium.org/10911082/diff/12001/pylib/gyp/input.py File pylib/gyp/input.py (right): http://codereview.chromium.org/10911082/diff/12001/pylib/gyp/input.py#newcode447 pylib/gyp/input.py:447: # Wrapper around LoadTargetBuildFile used when LoadTargetBuildFile On 2012/09/27 ...
8 years, 2 months ago (2012-09-28 18:05:21 UTC) #12
dmazzoni
8 years, 2 months ago (2012-09-28 18:35:19 UTC) #13
Committed r1508

Powered by Google App Engine
This is Rietveld 408576698