8d47c48082
Having soong generate a list of makefiles for mk2rbc to look through is much faster than having mk2rbc search itself. Profiling the readLinesFromeFile() function that reads the list of makefiles shows it takes on the order of 200 microseconds, much faster than the ~5 seconds it takes for mk2rbc to search the tree itself. This CL also allows include statements that are prefixed with a variable. The concern with this was that there would be a lot of load statemnts emitted for generic include statements, causing the generated code to look ugly, and converting and loading all those files could cause performance issues. On the performance issues front, there's already a check that it doesn't result in over 150 potentially included files. We can lower that number if necessary, but it's probably good for now. On the generated code front, while it's true that it's ugly, it's better to have working but ugly generated code than refusing to generate anything working at all. To ensure the soong finder step isn't slowed down due to having to find a bunch of new makefiles, I profiled the combination of newSourceFinder and FindSources in main.go: Baseline incremental: 338.011634ms 340.853335ms 348.541762ms 333.229644ms 349.124824ms Baseline clean: 1.003836419s 1.006203912s 996.193648ms 1.031005604s 1.03691152s Modified incremental: 349.029285ms 349.264496ms 351.774948ms 337.63187ms 359.425306ms Modified clean: 1.028238704s 1.053103506s 1.032757506s 1.016631201s 1.04288108s So we can see the times are barely affected by this change. Fixes: 213508006 Test: go test Change-Id: Iab18bfb127ba3b7e63f2c01f69064805a8398764 |
||
---|---|---|
.. | ||
check_boot_jars | ||
hiddenapi | ||
Android.bp | ||
archive_repack.sh | ||
build-aml-prebuilts.sh | ||
build-ndk-prebuilts.sh | ||
build-rustdocs.sh | ||
build_broken_logs.go | ||
check_do_not_merge.sh | ||
construct_context.py | ||
construct_context_test.py | ||
conv_linker_config.py | ||
diff_build_graphs.sh | ||
freeze-sysprop-api-files.sh | ||
gen-java-current-api-files.sh | ||
gen-kotlin-build-file.py | ||
gen-sysprop-api-files.sh | ||
gen_java_usedby_apex.sh | ||
gen_ndk_backedby_apex.sh | ||
gen_ndk_usedby_apex.sh | ||
generate-notice-files.py | ||
get_clang_version.py | ||
get_clang_version_test.py | ||
jar-args.sh | ||
jar-wrapper.sh | ||
jars-to-module-info-java.sh | ||
jsonmodify.py | ||
lint_project_xml.py | ||
lint_project_xml_test.py | ||
manifest.py | ||
manifest_check.py | ||
manifest_check_test.py | ||
manifest_fixer.py | ||
manifest_fixer_test.py | ||
mergenotice.py | ||
microfactory.bash | ||
ninja_rsp.py | ||
OWNERS | ||
package-check.sh | ||
rbc-run | ||
reverse-deps.sh | ||
rustfmt.toml | ||
setup-android-build.sh | ||
setup_go_workspace_for_soong.sh | ||
strip.sh | ||
system-clang-format | ||
system-clang-format-2 | ||
test_config_fixer.py | ||
test_config_fixer_test.py | ||
toc.sh | ||
transitive-deps.sh | ||
unpack-prebuilt-apex.sh | ||
update_out |