Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9036882d authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi
Browse files

[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
parent da61b0b8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment