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

Commit 39213274 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

libandroidfw: Improve performance of AssetManager2

AssetManager2 relied on creating a list of configurations
present in the resource table so as to avoid copying and
converting ResTable_config's from the APK on every
resource retrieval.

ResTable, however, had a better optimization that pruned
the configurations that didn't match the currently set
configuration. This vastly reduced the number of ResTable_configs
to test.

In this CL, AssetManager2 follows suite with this optimization
and only maintains the filtered ResTable_configs, falling back
to the slow path when the configuration is overridden.

Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I42d53f703623cf7c3f7cbcf194f5026ff540faf4
parent 62f17129
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ cc_test {
        "tests/TypeWrappers_test.cpp",
        "tests/ZipUtils_test.cpp",
    ],
    static_libs: ["libgmock"],
    target: {
        android: {
            srcs: [
+210 −63

File changed.

Preview size limit exceeded, changes collapsed.

+83 −178

File changed.

Preview size limit exceeded, changes collapsed.

+49 −17

File changed.

Preview size limit exceeded, changes collapsed.

+67 −44

File changed.

Preview size limit exceeded, changes collapsed.

Loading