summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-10-05 14:24:35 -0700
committerRyan Mitchell <rtmitchell@google.com>2020-11-12 08:13:48 -0800
commit87e89546b66da6d5098b46ff9b868ef82a753932 (patch)
treec99f5e1e0f712e5fcf88c928b8ed03f96b067392 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parentc75c2e092218a7d77be39c89bfba7dd2b4823ac1 (diff)
Cache resolved theme values
When calling Resources#obtainStyledAttributes, if a value for an attribute is supplied from the theme, and the value in the theme is a reference to a resource, the reference will be resolved using AssetManager2::ResolveReference each time the value from the theme is selected. This causes Resources#obtainStyledAttributes to do repeated work every time the same attribute is supplied from the theme in multiple invocations. Caching the result of ResolveReference reduces the cost of this repeated work and reduces the amount of time needed to inflate views. Before: com.android.resources.perf (3 Tests) [1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.748s) youtube_ns_median: 95490747 youtube_ns_standardDeviation: 7282249 youtube_ns_mean: 98442515 [2/3] com.android.resources.perf.PerfTest#maps: PASSED (10.862s) maps_ns_standardDeviation: 4484213 maps_ns_mean: 87912988 maps_ns_median: 86325549 [3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.034s) gmail_ns_median: 282175838 gmail_ns_standardDeviation: 6560876 gmail_ns_mean: 282869146 After: com.android.resources.perf (3 Tests) [1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.245s) youtube_ns_median: 92292347 youtube_ns_standardDeviation: 5899906 youtube_ns_mean: 93045239 [2/3] com.android.resources.perf.PerfTest#maps: PASSED (10.583s) maps_ns_standardDeviation: 7567929 maps_ns_mean: 81895979 maps_ns_median: 78647883 [3/3] com.android.resources.perf.PerfTest#gmail: PASSED (21.439s) gmail_ns_median: 229185043 gmail_ns_standardDeviation: 8770133 gmail_ns_mean: 232561234 These tests were done on a Pixel 3 and with cpu settings configured by libs/hwui/tests/scripts/prep_generic.sh: Locked CPUs 4,5,6,7 to 1459200 / 2803200 KHz Disabled CPUs 0,1,2,3 Bug: 170232288 Test: atest ResourcesPerfWorkloads Change-Id: I1e9e9acaa40fa60475a0e55230e11243f5b69b39
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions