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
19 lines
456 B
Bash
Executable File
19 lines
456 B
Bash
Executable File
#!/bin/bash
|
|
|
|
OUTPUT_default=res/values/strings.xml
|
|
OUTPUT_v26=res/values-v26/strings.xml
|
|
|
|
echo "<resources>" > $OUTPUT_default
|
|
echo "<resources>" > $OUTPUT_v26
|
|
for i in {0..999}
|
|
do
|
|
echo " <string name=\"foo_$i\">$i</string>" >> $OUTPUT_default
|
|
if [ "$(($i % 3))" -eq "0" ]
|
|
then
|
|
echo " <string name=\"foo_$i\">$(($i * 10))</string>" >> $OUTPUT_v26
|
|
fi
|
|
done
|
|
echo "</resources>" >> $OUTPUT_default
|
|
echo "</resources>" >> $OUTPUT_v26
|
|
|