Efficient Profile-Guided Size Optimization for Native Mobile Applications
Positive user experience of mobile apps demands they not only launch fast and run fluidly, but are also small in order to reduce network bandwidth from regular updates. Conventional optimizations often trade off size regressions for performance wins, making them impractical in the mobile space. Indeed, profile-guided optimization (PGO) is successful in server workloads, but is not effective at reducing size and page faults for mobile apps. Also, profiles must be collected from instrumenting builds that are up to 2X larger, so they cannot run normally on real mobile devices. In this paper, we first introduce Machine IR Profile (MIP), a lightweight instrumentation that runs at the machine IR level. Unlike the existing LLVM IR instrumentation counterpart, MIP withholds static metadata from the instrumenting binaries leading to a 2/3 reduction in size overhead. In addition, MIP collects profile data that is more relevant to optimizations in the mobile space. Then we propose three improvements to the LLVM machine outliner: (i) the global outliner overcomes the local scope of the machine outliner when using ThinLTO, (ii) the frame outliner effectively outlines irregular prologues and epilogues, and (iii) the custom outliner outlines frequent patterns occurring in Objective-C and Swift. Lastly, we present our PGO that orders hot start-up functions to minimize page faults, and controls the size optimization level (-Os vs -Oz) for functions based on their estimated execution time driven from MIP. We also order cold functions based on similarity to minimize the compressed app size. Our work improves both the size and performance of real-world mobile apps when compared to the MinSize (-Oz) optimization level: (i) in SocialApp, we reduced the compressed app size by 5.2%, the uncompressed app size by 9.6% and the page faults by 20.6%, and (ii) in ChatApp, we reduced them by 2.4%, 4.6% and 36.4%, respectively.
Wed 6 AprDisplayed time zone: Eastern Time (US & Canada) change
13:00 - 14:00 | Session 6: Performance OptimizationsCC Research Papers at CC Virtual Room Chair(s): Doru Thom Popovici Lawrence Berkeley National Lab | ||
13:00 15mPaper | Loner: Utilizing the CPU Vector Datapath to Process Scalar Integer Data CC Research Papers Armand Behroozi University of Michigan, Sunghyun Park University of Michigan, Scott Mahlke University of Michigan DOI | ||
13:15 15mPaper | Mapping Parallelism in a Functional IR through Constraint Satisfaction CC Research Papers Naums Mogers University of Edinburgh, Lu Li University of Edinburgh, Valentin Radu University of Sheffield, Christophe Dubach McGill University DOI | ||
13:30 15mPaper | Software Pre-execution for Irregular Memory Accesses in the HBM Era CC Research Papers DOI | ||
13:45 15mPaper | Efficient Profile-Guided Size Optimization for Native Mobile Applications CC Research Papers DOI |