Run flutter license script with dart --intrepret_irregexp runtime option (flutter/engine#41646)

For extremely large RegExp's that are used in flutter license script, running interpreter-based implementation is faster than running generated unoptimized code. For normal-sized RegExp's optimized code is expected to be faster.

Local testing shows 5x speed up on full license script run (311s vs 1430s).

Should help with https://github.com/flutter/flutter/issues/118193
This commit is contained in:
Alexander Aprelev
2023-05-01 15:07:06 -07:00
committed by GitHub
parent 89daa2770d
commit 2f2dc81599

View File

@@ -72,10 +72,15 @@ function run_tests() (
# Runs in a subshell.
function collect_licenses() (
cd "$SRC_DIR/flutter/tools/licenses"
dart --enable-asserts lib/main.dart \
--src ../../.. \
--out ../../../out/license_script_output \
--golden ../../ci/licenses_golden \
# `--interpret_irregexp`` tells dart to use interpreter mode for running
# the regexp matching, rather than generating machine code for it.
# For very large RegExps that are currently used in license script using
# interpreter is faster than using unoptimized machine code, which has
# no chance of being optimized(due to its size).
dart --enable-asserts --interpret_irregexp lib/main.dart \
--src ../../.. \
--out ../../../out/license_script_output \
--golden ../../ci/licenses_golden \
"${QUIET}"
)