[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
Loading
Please register or sign in to comment