论文标题

本机移动应用程序的链接器代码大小优化

Linker Code Size Optimization for Native Mobile Applications

论文作者

Liu, Gai, Farooq, Umar, Zhao, Chengyan, Liu, Xia, Sun, Nian

论文摘要

现代移动应用程序已迅速增长,二进制规模限制了用户的增长并阻碍了现有用户的更新。因此,减少二进制规模对于应用程序开发人员很重要。最近的研究表明,通过在程序的链接中间表示上重新启动某些编译器优化,可以使用链接时间代码大小优化。但是,这种方法通常会产生大量的构建时间开销,并需要对现有的构建管道进行侵入性更改。 在本文中,我们提出了几种新颖的优化技术,这些技术不需要对构建管道进行大量自定义,并降低了二进制规模,而构建时间较低。与在链接时间期间重新启动编译器相比,我们直接在链接器内部进行了真正的链接器优化。这使得更多优化机会,例如先前工作通常无法优化的预编译库。我们在几个商业iOS应用程序上评估了我们的技术,包括NewsFeedApp,ShortVideoApp和ClocalivationSuitEapp,每个应用程序都有数亿日常活跃的用户。我们的技术平均在三个商业应用程序中实现了18.4%的二元尺寸降低,而没有任何用户可见的性能降解。

Modern mobile applications have grown rapidly in binary size, which restricts user growth and hinders updates for existing users. Thus, reducing the binary size is important for application developers. Recent studies have shown the possibility of using link-time code size optimizations by re-invoking certain compiler optimizations on the linked intermediate representation of the program. However, such methods often incur significant build time overhead and require intrusive changes to the existing build pipeline. In this paper, we propose several novel optimization techniques that do not require significant customization to the build pipeline and reduce binary size with low build time overhead. As opposed to re-invoking the compiler during link time, we perform true linker optimization directly as optimization passes within the linker. This enables more optimization opportunities such as pre-compiled libraries that prior work often could not optimize. We evaluate our techniques on several commercial iOS applications including NewsFeedApp, ShortVideoApp, and CollaborationSuiteApp, each with hundreds of millions of daily active users. Our techniques on average achieve 18.4% binary size reduction across the three commercial applications without any user-perceivable performance degradations.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源