summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-10-16 16:18:09 -0700
committerAdam Lesinski <adamlesinski@google.com>2017-10-17 11:37:49 -0700
commit30080e2f282f40222bd9cc617e0c11d63c82f829 (patch)
treed7cd37fc9a3dbd3369e53db221623f3fdf8b0c4d /tools/aapt2/java/JavaClassGenerator.cpp
parent8a0f0ed4d84573a2f9eec0753404b5cf44f51827 (diff)
AssetManager2: Improve Theme performance
This change brings Theme ApplyStyle down to 2x the original performance and Theme attribute retrieval to less than the original performance. Yay! Benchmarks ran on marlin-eng ---------------------------------------------------------------------- Benchmark Time CPU Iterations ---------------------------------------------------------------------- BM_ThemeApplyStyleFramework 8540 ns 8500 ns 82105 BM_ThemeApplyStyleFrameworkOld 5280 ns 5258 ns 148849 BM_ThemeGetAttribute 8 ns 8 ns 88388549 BM_ThemeGetAttributeOld 11 ns 11 ns 63394463 ApplyStyle still takes some time, and the weird thing is that if I switch the data structure of ThemeType to use an std::vector<ThemeEntry>, the performance becomes better than the original implementation! The issue is that std::vector<T> takes up 24 bytes, which would make Themes take up 8 more bytes per ThemeType, which is unacceptable. Still trying to isolate where the performance gain is coming from. Test: make libandroidfw_tests && $ANDROID_BUILD_TOP/out/host/<host>/nativetest64/libandroidfw_tests/libandroidfw_tests Test: make libandroidfw_benchmarks && adb sync system && adb sync data && adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks Change-Id: I0e7a756afd44b6aac1521e69c2b907258c262d3e
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions