summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/ProgramFragmentFixedFunction.java
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2021-06-07 11:22:30 -0700
committerRyan Mitchell <rtmitchell@google.com>2021-06-08 09:12:32 -0700
commit3c6480c8d85feb52ea1908c1f5b0627dc7821a7a (patch)
tree054293d05ff82487d26ced6dc27d29128f9f6ed0 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java
parent72cd5f15528e6b930fadfdef1d79722ea7ff02e7 (diff)
Sparse native theme representation
Themes are represented in the native layer using an array where the entry id of resource ids are used to index into the array. This causes native allocation size of a theme to correlate with the largest attribute resource id in the styles applied to the theme. From manual testing, I determined that on average in 1P apps and system_server only 10-20% of the space allocated for themes actually hold theme attribute values and the rest is empty/unused space. Using std::vector and std::lower_bound to create a sparse array representation will reduce amount of memory allocated by themes while having a minimal impact on the performance of querying the attributes defined in a theme. From testing with ResourcesPerfWorkloads, this increased time spent in the resources synthetic benchmarks by ~1%. Bug: 141198925 Test: atest libandroidfw_tests Test: atest ResourcesPerfWorkloads Change-Id: Iec512b31b0545b0898ff248cd23f074a20fff45d
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions