一句话:提出基于基本块节与重链接的剖析引导后链接优化器 Propeller,在分布式构建下提升仓库级应用性能。
剖析引导优化(PGO)与链接时优化(LTO)已被广泛采用,但后链接优化(PLO)因反汇编驱动的单体式设计而难以扩展,且与分布式构建系统相冲突。本文提出 Propeller——面向仓库级工作负载的重链接优化器。作者引入 basic block sections 这一新型链接器抽象,使 Propeller 无需反汇编即可进行灵活的代码布局优化,并通过用精确剖析信息重链接二进制而非重写二进制来获得可扩展性;借助缓存与在代码生成阶段复用分布式编译动作来降低重链接开销。Propeller 已在 Google 生产环境部署,任意时刻有数千万核运行其优化代码。对内部仓库级应用的评估显示,相比 PGO 与 ThinLTO,Propeller 带来 1.1%–8% 的性能提升(Clang 提升 7%,MySQL 提升 1%);与最先进的二进制优化器相比性能相当,而在大型基准上内存开销降低 30%–70%。
While profile guided optimizations (PGO) and link time optimiza-tions (LTO) have been widely adopted, post link optimizations (PLO)have languished until recently when researchers demonstrated that late injection of profiles can yield significant performance improvements. However, the disassembly-driven, monolithic design of post link optimizers face scaling challenges with large binaries andis at odds with distributed build systems. To reconcile and enable post link optimizations within a distributed build environment, we propose Propeller, a relinking optimizer for warehouse scale work-loads. To enable flexible code layout optimizations, we introduce basic block sections, a novel linker abstraction. Propeller uses basic block sections to enable a new approach to PLO without disassembly. Propeller achieves scalability by relinking the binary using precise profiles instead of rewriting the binary. The overhead of relinking is lowered by caching and leveraging distributed compiler actions during code generation. Propeller has been deployed to production at Google with over tens of millions of cores executing Propeller optimized code at any time. An evaluation of internal warehouse-scale applications show Propeller improves performance by 1.1% to 8% beyond PGO and ThinLTO. Compiler tools such as Clang improve by 7% while MySQL improves by 1%. Compared to the state of the art binary optimizer, Propeller achieves comparable performance while lowering memory overheads by 30%-70% on large benchmarks.
@inproceedings{paperbot10021,
title = {Propeller: A Profile Guided, Relinking Optimizer for Warehouse-Scale Applications},
author = {Han Shen and Krzysztof Pszeniczny and Rahman Lavaee and Snehasish Kumar and Sriraman Tallam and Xinliang David Li},
booktitle = {ASPLOS},
year = {2023},
doi = {10.1145/3575693.3575727}
}