summaryrefslogtreecommitdiff
path: root/tools/aapt2/LoadedApk.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2017-02-08 07:03:50 -0800
committer Adam Lesinski <adamlesinski@google.com> 2017-02-15 12:40:02 -0800
commitc8f71aa67ea599cb80205496cb67e9e7a121299c (patch)
tree2966aa97b09f04f9b7379fd93a7fc3ea1ae9009f /tools/aapt2/LoadedApk.cpp
parentc535d122c6a58a152ff2581f936070c2695c45ba (diff)
Add ResTable_sparseTypeEntry support
Benchmarks on bullhead-userdebug show that there is a negligent performance impact when using sparse entries on a 30% loaded sparse type of 1000 resources. Benchmark Time CPU Iterations ----------------------------------------------------------------------------------- BM_SparseEntryGetResourceSparseLarge 255 ns 254 ns 2751408 BM_SparseEntryGetResourceNotSparseLarge 254 ns 254 ns 2756534 Bug: 27381711 Test: make libandroidfw_tests aapt2_tests Change-Id: I051ea22f2f6b2bc3696e446adc9e2a34be18009f
Diffstat (limited to 'tools/aapt2/LoadedApk.cpp')
-rw-r--r--tools/aapt2/LoadedApk.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/aapt2/LoadedApk.cpp b/tools/aapt2/LoadedApk.cpp
index 3d7bd9479ad8..407550b112dc 100644
--- a/tools/aapt2/LoadedApk.cpp
+++ b/tools/aapt2/LoadedApk.cpp
@@ -94,7 +94,9 @@ bool LoadedApk::WriteToArchive(IAaptContext* context, IArchiveWriter* writer) {
// The resource table needs to be reserialized since it might have changed.
if (path == "resources.arsc") {
BigBuffer buffer = BigBuffer(1024);
- TableFlattener flattener(&buffer);
+ // TODO(adamlesinski): How to determine if there were sparse entries (and if to encode
+ // with sparse entries) b/35389232.
+ TableFlattener flattener({}, &buffer);
if (!flattener.Consume(context, table_.get())) {
return false;
}