summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimization.cc
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2022-08-07 01:12:24 +0100
committer Jiakai Zhang <jiakaiz@google.com> 2022-08-17 16:14:30 +0000
commit7a5a95fd77a0d2d00a42a5437e0ee243f9c4da07 (patch)
treee6a769dd84388995e363cb79fd6328662799fa61 /compiler/optimizing/optimization.cc
parentdc386f664046e35702a707660c6263ffea200d71 (diff)
Add a helper class OfaContext for OatFileAssistant.
OfaContext fetches and caches information including boot image checksums, bootclasspath checksums, and APEX versions. This change eliminates the unnecessary reads of the art files, oat files, and dex files in the slow path of app oat header validation on app startup. After this change, there is no longer a "fast path" and a "slow path". Instead, OfaContext always gets the boot image checksums and BCP checksums from the runtime. (Trace before: http://screen/6CPziPGmG92Mrw2, Trace after: http://screen/gzpUEcJ3R78fWiJ) OfaContext can be kept on the caller side so that the cache can be reused, making callers like artd faster on repetitive calls to OatFileAssistant. After this change, calling Artd::getOptimizationStatus 100 times takes 600ms less total time. For example, running `adb shell pm art get-optimization-status com.google.android.youtube` 100 times took 3.2s on average on Cuttlefish before this change, but now takes 2.6s after this change. In addition, after this change, the responsibilities of OatFileAssistant and ImageSpace are divided in a better way. ImageSpace is purely responsible for loading and validating boot images. It is no longer responsible for validating app oat headers. Instead, this responsibility is now taken by OatFileAssistant. `--validate-bcp` is removed from dexoptanalyzer because no one is using it. Partially cherry picked from commit 8e515fb047e548fed89decb18d677d30fb708a9c. Bug: 238394854 Bug: 229268202 Test: m test-art-host-gtest-art_runtime_tests Test: atest ArtGtestsTargetChroot Test: art/test.py --host -r Test: atest art_standalone_dexpreopt_tests Test: atest odsign_e2e_tests_full Merged-In: I83b43684d78c91e649300929ca2f348c626e1cab Change-Id: I5a4bf68e32fcafe14ed474c4b3946da1421585ce
Diffstat (limited to 'compiler/optimizing/optimization.cc')
0 files changed, 0 insertions, 0 deletions