diff options
author | Winson <chiuwinson@google.com> | 2020-04-15 12:41:03 -0700 |
---|---|---|
committer | Winson <chiuwinson@google.com> | 2020-09-14 15:06:41 -0700 |
commit | c086fe9ac1bd33ddc6c6aa681f7c92eababdceb0 (patch) | |
tree | 8299ec386a76cab0732b6a26c4361b16c7fa1a2e /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | e78c0050bb17e300940519ff5c9dce2fbeec65ad (diff) |
Optimize (Parsing)PackageImpl implementation
To speed up recurring ApplicationInfo creation, this caches
the the appInfoFlags/appInfoPrivateFlags at parse time, since
they're immutable at that point. This saves having to calculate
it hundreds of times for all the packages in getInstalledPackages
or similar.
This also saves the base app data directories for the system user,
or user 0, interning the strings since they're shared across
packages with the same volume UUID. A better solution would
cache these paths during boot scan and re-use the strings directly
rather than re-building and relying on interning, but there was
no good mechanism for that.
This decreases string append computation time and compromises
between persistent memory and performance.
This also compacts boolean fields into a bitset, decreasing
the amount persisted in both the object memory and the Parcelable
output.
In combination these changes result in a net decrease in memory
usage, although the difference is neglible, on the order of
~4KB for 181 packages or ~22B a package. The increase in speed is
roughly 2/3rds saved off the total time of generateWithComponents.
An important note is that hideAsParsed/hideAsFinal are now
required to be called because they now calculate the derived
fields to be cached.
Bug: 153656459
Test: atest CrossProfileAppsServiceImplRoboTest
Test: atest PackageManagerComponentLabelIconOverrideTest
Test: atest PackageParserTest
Test: atest UserSystemPackageInstallerTest
Test: atest DexoptUtilsTest
Test: atest com.android.server.pm.parsing
Test: atest PackageInfoUserFieldsTest
Test: atest com.android.server.pm.ScanTests
Test: atest android.content.pm.cts.PackageManagerTest
Change-Id: I977edb9dec720893ccb1ce5b9df33733c408d3c1
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions