Reordering Functions in Mobiles Apps for Reduced Size and Faster Start-Up
Open Access
- 10 June 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Embedded Computing Systems
- Vol. 23 (4) , 1-54
Abstract
Function layout, also known as function reordering or function placement, is one of the most effective profile-guided compiler optimizations. By reordering functions in a binary, compilers can improve the performance of large-scale applications or reduce the compressed size of mobile applications. Although the technique has been extensively studied in the context of large-scale binaries, no study has thoroughly investigated function layout algorithms on mobile applications. In this article, we develop the first principled solution for optimizing function layouts in the mobile space. To this end, we identify two key optimization goals: reducing the compressed code size and improving the cold start-up time of a mobile application. Then, we propose a formal model for the layout problem, whose objective closely matches our goals, and a novel algorithm for optimizing the layout. The method is inspired by the classic balanced graph partitioning problem. We have carefully engineered and implemented the algorithm in an open-source compiler, Low-level Virtual Machine (LLVM). An extensive evaluation of the new method on large commercial mobile applications demonstrates improvements in start-up time and compressed size compared to the state-of-the-art approach. 1Keywords
This publication has 45 references indexed in Scilit:
- Toward a Definitive Compressibility Measure for Repetitive SequencesIEEE Transactions on Information Theory, 2022
- Improved Basic Block ReorderingIEEE Transactions on Computers, 2020
- Recent Advances in Graph Partitioning2016
- Online Paging and Caching2016
- Graph Partitioning2013
- Sublinear Algorithms for Approximating String CompressibilityAlgorithmica, 2012
- Balanced Graph PartitioningTheory of Computing Systems, 2006
- Competitive paging algorithmsJournal of Algorithms, 1991
- A universal algorithm for sequential data compressionIEEE Transactions on Information Theory, 1977
- An Efficient Heuristic Procedure for Partitioning GraphsBell System Technical Journal, 1970