Modern mobile applications have grown rapidly in binary size, which restricts user growth and 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 open-source and commercial iOS applications including NewsFeedApp, ShortVideoApp, and CollaborationSuiteApp, each with hundreds of millions of daily active users. Our technique on average achieves 12.6% binary size reduction across the three commercial applications without any user-perceivable performance degradations.
翻译:现代移动应用程序在二进制规模上迅速增长,限制了现有用户的用户增长和更新。 因此, 降低二进制规模对于应用程序开发者来说很重要 。 最近的研究显示, 有可能通过在相连接的中间代表器上重新援引某些编译器优化程序, 从而使用连接时间代码的优化。 但是, 这些方法往往需要大量建立时间管理, 并且需要对现有的建构管道进行侵入性改变 。 在本文中, 我们建议了几种新型优化技术, 这些技术不需要对建构管道进行重大定制, 并且用低建构时间管理来减少二进制规模。 相对于在连接时间里重新启用编译器, 我们直接进行真正的连接器优化, 以作为链接器内部的优化通道。 这样可以提供更多优化机会, 比如, 之前的工作通常无法优化的编译前图书馆 。 我们评估了几个开源和商用iOS应用程序的技术, 包括 NewFeedApp, ShortVideoApp, 和 CompanySiteApp, pp, 每个每天有数千万个用户。 我们的技术平均在三个商业应用程序中实现12.6%的二进制规模缩小。