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

Issue 2471713003: [gn] Consolidate calls to gypi_to_gn to speed up GN generation

Created:
4 years, 1 month ago by jamesr
Modified:
4 years, 1 month ago
Reviewers:
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[gn] Consolidate calls to gypi_to_gn to speed up GN generation Calling out to python from GN to process gypi files is relatively expensive with a 20-45ms fixed overhead for setup/teardown regardless of what the script does. This makes runtime/vm/BUILD.gn take 1-1.5s (per toolchain) to run as the template for libraries expands out to 25 calls to gypi_to_gn.py, even though the actual time spent processing the gypi files is negligible. This replaces those repeated calls to gypi_to_gn.py with a call to a custom script that process all of the gypi files and places the results into a single scope which can then be read from in the template and replaces a few other scattered calls to gypi_to_gn.py with a smaller number of calls that process multiple gypi files and place the results into a single scope. The end result is processing all of dart's GN files in a fuchsia build takes ~250ms instead of >3 seconds. The process_gypis.py changes require a GN version newer than r???? as they depend on the ability to index into a GN scope with a string.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -182 lines) Patch
M runtime/bin/BUILD.gn View 10 chunks +10 lines, -53 lines 0 comments Download
A runtime/bin/gypi_contents.gni View 1 chunk +43 lines, -0 lines 0 comments Download
M runtime/vm/BUILD.gn View 12 chunks +45 lines, -71 lines 0 comments Download
A runtime/vm/gypi_contents.gni View 1 chunk +54 lines, -0 lines 0 comments Download
M tools/gypi_to_gn.py View 6 chunks +40 lines, -58 lines 0 comments Download
A tools/process_gypis.py View 1 chunk +69 lines, -0 lines 0 comments Download

Powered by Google App Engine
This is Rietveld 408576698