diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-12-28 13:01:35 -0800 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2018-01-18 10:40:10 -0800 |
commit | 62f17129a0c519fe3e591be102b1863024cea3a4 (patch) | |
tree | 3ecc2095606354bfb205336469e970888c69393f /libs/androidfw/tests/BenchmarkHelpers.cpp | |
parent | c857766ca5aa37df0833c816922e6b3b85a742f9 (diff) |
libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I021bc53e85651dcf5fbd4ebaae72d82be1a03252
Diffstat (limited to 'libs/androidfw/tests/BenchmarkHelpers.cpp')
-rw-r--r-- | libs/androidfw/tests/BenchmarkHelpers.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/androidfw/tests/BenchmarkHelpers.cpp b/libs/androidfw/tests/BenchmarkHelpers.cpp index a8abcb5df86c..faddfe599af4 100644 --- a/libs/androidfw/tests/BenchmarkHelpers.cpp +++ b/libs/androidfw/tests/BenchmarkHelpers.cpp @@ -42,10 +42,12 @@ void GetResourceBenchmarkOld(const std::vector<std::string>& paths, const ResTab Res_value value; ResTable_config selected_config; uint32_t flags; + uint32_t last_ref = 0u; while (state.KeepRunning()) { - table.getResource(resid, &value, false /*may_be_bag*/, 0u /*density*/, &flags, - &selected_config); + ssize_t block = table.getResource(resid, &value, false /*may_be_bag*/, 0u /*density*/, &flags, + &selected_config); + table.resolveReference(&value, block, &last_ref, &flags, &selected_config); } } @@ -72,10 +74,12 @@ void GetResourceBenchmark(const std::vector<std::string>& paths, const ResTable_ Res_value value; ResTable_config selected_config; uint32_t flags; + uint32_t last_id = 0u; while (state.KeepRunning()) { - assetmanager.GetResource(resid, false /* may_be_bag */, 0u /* density_override */, &value, - &selected_config, &flags); + ApkAssetsCookie cookie = assetmanager.GetResource( + resid, false /* may_be_bag */, 0u /* density_override */, &value, &selected_config, &flags); + assetmanager.ResolveReference(cookie, &value, &selected_config, &flags, &last_id); } } |