diff options
author | 2024-12-17 19:21:16 -0800 | |
---|---|---|
committer | 2024-12-19 21:27:18 -0800 | |
commit | 9036882d49841883a673a401f932845ccf6361bb (patch) | |
tree | 019cf2f0b57aa5f261ced736d5595a7697b2b034 /libs/androidfw/Util.cpp | |
parent | da61b0b812fb119b044026acf861099afae6a3fb (diff) |
[res] Optimize isUpToDate() for ApkAssets
This is the most called function in the whole Resources
codebase, and it often takes a millisecond+ to just check if
the underlying file still exists.
This CL optimizes several aspects of the function
- knowing that all /data/ paths are writable, return early from
the isReadonlyFilesystem() without a syscall
- use the same getFileModDate() function for all native classes
instead of the custom stat-based code
- skip the modification time getter for all readonly filesystems
when we know that the idmap, overlay and target can't change.
- add some default-disabled logging code to print timings for
easier performance measurement
Bug: 319137634
Test: build, boot and atest libandroidfw_tests
Flag: EXEMPT performance-critical code that can't have two
versions
Change-Id: I0f801bef386f202eda775cca9657e2a0b6b55c95
Diffstat (limited to 'libs/androidfw/Util.cpp')
0 files changed, 0 insertions, 0 deletions