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

Skip to content
Commit 657f3c6b authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi
Browse files

[res] Speed up AssetManager pointer locking

AssetManager needs to lock (promote()) apk asset weak pointers
to use them in pretty much any operation, and often mulitple
times for the same object.

This CL introduces a concept of an 'operation' in AssetManager,
and adds a cache for the locked assets that are retained until
the end of that operation. This way we only need to lock each
assets object exactly once, losing pretty much no performance.

Benchmarks all returned to the pre-memory-safe state values.

Bug: 280951693
Bug: 197260547
Bug: 276922628
Test: UTs + native benchmarks + java benchmarks + boot
(cherry-picked from https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/23146856)
Merged-In: I26ef88df4f6267b5e8b89f1588f2382db74030c0
Change-Id: I26ef88df4f6267b5e8b89f1588f2382db74030c0
parent 1cf74939
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment