|
[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.
|