Improve package parser validation performance
Minimize the regression to the Package Parser with the addition of the validator by removing the validation in ApkLite to prevent validation of the manifest twice during installs. The overall manifest tag limit check was also removed since the child tag limits already effectively prevents excessive tag exploits. The mTagCounters HashMap performance also had a relatively large performance impact in the regression. To minimize this, the hashmap is replaced with a switch statement and bitmask. For comparison, the mean parsing time measured from PackageParsingPerfTest#parallelNoCache runs on a lynx-userdebug build shows that the regression has been improved to ~9%. The measured times are: old validation 465069440 new validation 412830497 no validation 376371320 Bug: 289190523, 267185315 Test: atest PackageParsingPerfTest Test: atest AndroidPackageParsingValidationTest Change-Id: I3e0954278254ddeb1ec18d00e4f2d0afec0d9954
Loading
Please register or sign in to comment