论文标题
优化移动应用程序的功能布局
Optimizing Function Layout for Mobile Applications
论文作者
论文摘要
功能布局(也称为功能重新排序或功能放置)是最有效的配置文件指导的编译器优化之一。通过在二进制中重新排序功能,编译器可以大大提高大型应用程序的性能或减少移动应用程序的压缩大小。尽管该技术是在大型二进制文件的背景下进行了研究的,但最近没有研究研究功能布局对移动应用的影响。 在本文中,我们开发了第一个原理解决方案,以优化移动空间中的功能布局。为此,我们确定了两个重要的优化目标,即压缩代码大小和移动应用程序的冷启动时间。然后,我们为布局问题提出了一个正式的模型,其目标与目标非常匹配。我们的新颖算法优化布局的灵感来自经典的平衡图分区问题。我们在开源编译器LLVM中仔细设计和实施该算法。对大型商业移动应用程序的新方法的广泛评估表明,在最先进的方法之上,最高2%的压缩尺寸减小,最高3%的启动时间提高。
Function layout, also referred to as function reordering or function placement, is one of the most effective profile-guided compiler optimizations. By reordering functions in a binary, compilers are able to greatly improve the performance of large-scale applications or reduce the compressed size of mobile applications. Although the technique has been studied in the context of large-scale binaries, no recent study has investigated the impact of function layout on mobile applications. In this paper we develop the first principled solution for optimizing function layouts in the mobile space. To this end, we identify two important optimization goals, the compressed code size and the cold start-up time of a mobile application. Then we propose a formal model for the layout problem, whose objective closely matches the goals. Our novel algorithm to optimize the layout is inspired by the classic balanced graph partitioning problem. We carefully engineer and implement the algorithm in an open source compiler, LLVM. An extensive evaluation of the new method on large commercial mobile applications indicates up to 2% compressed size reduction and up to 3% start-up time improvement on top of the state-of-the-art approach.