summaryrefslogtreecommitdiff
path: root/compiler/optimizing/codegen_test_utils.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2020-04-28 12:28:21 +0100
committerVladimir Marko <vmarko@google.com>2020-05-06 08:05:59 +0000
commit9e4b42ad325ee8583b3c98550010516a3a127527 (patch)
treed9b2dcb265434d03aacbd1fe5e4b96c8217c018c /compiler/optimizing/codegen_test_utils.h
parent5477b8e55f01a58fac188f272818b38a19c50d4e (diff)
Refactor vdex file writing.
Instead of unzipping dex files to the vdex file using a file descriptor, reserve space in the vdex file and mmap it to memory and unzip dex files to memory. Postpone any flushes until after we have finalized the contents, then flush the contents without header, then store and flush the header. Testing with a certain big app on aosp_taimen-userdebug and using --dump-timings to show the timing for different phases of compilation shows significant improvements. The time of "Write Dex files" goes from ~1s down to ~0.3s and also the "OpenDexFiles" is reduced from ~0.3s to ~0.2s. The latter is presumably caused by having the memory pages already filled with data because this change does not touch that code. The "dex2oat Write VDEX" phase time does not significantly change but it has an impact on the time of the enclosing "dex2oat Oat" phase, increasing it by up to ~0.2s. This change also prepares for future improvements, such as doing the dex file extraction on multiple threads (one task per dex file, helping with multi-dex), or tuning when we flush the vdex file contents (dex file data could be flushed with an msync() on a separate thread while we're running the "dex2oat Compile" phase but that could be counter-productive for dex-to-dex compilation as we would potentially write the bytecode twice). Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boots. Bug: 34201138 Change-Id: I9dbc2b0b4e3bf1e3b2cbf78957356e1d4ca23f66
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
0 files changed, 0 insertions, 0 deletions