paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot Code

利用部分上下文敏感的剖析信息提升热代码性能
TOPLAS 45(4)2023匹配度 2/10 · 该论文研究基于部分上下文敏感 profile 的 AOT 编译优化与热代码检测,属于经典编译器/运行时优化方向,与用户核心关注的静态分析、LLM/Agent 交叉、浮点程序分析及贝叶斯程序分析均无直接关联。虽然其形式化描述与 GraalVM 工业实现符合用户对工程落地论文的部分偏好,但研究问题不在当前画像的主线上。引用 5 inbox
Maja Vukasovic, Aleksandar Prokopec
crossref: 2026-09-10

AI 速览

一句话:提出基于部分上下文敏感 profile 的热区重建与编译预算分配技术,在 GraalVM Native Image 中提升热代码性能并控制代码膨胀。

AOT 编译可利用程序独立 profiling 运行中获得的 profile 来指导优化,而部分上下文敏感 profile 只记录调用栈后缀,虽便于收集、开销低,但尚未被充分用于优化。本文提出一种新技术:根据部分上下文敏感 profile 判断哪些代码片段是热代码,并为其分配额外编译预算。方法依赖新的热代码检测算法,从部分 profile 中重建热区域,并修改编译顺序与内联策略以利用热代码信息。作者形式化描述了算法与启发式,并在 GraalVM Native Image 中实现。在 DaCapo、Scalabench 与 Renaissance 的 16 个基准上,4 个基准性能提升 22%–40%,5 个提升 2.5%–10%;代码大小增长 0.8%–9%,其中 10 个基准增长低于 2.5%。

问题
AOT 编译中如何有效利用只记录调用栈后缀的部分上下文敏感 profile,准确识别热代码并优化,同时避免显著增加代码大小。
方法
提出从部分上下文敏感 profile 重建热区域的热代码检测算法,并据此调整编译顺序、内联策略以及额外编译预算分配;形式化描述算法与启发式,并在 GraalVM Native Image 中实现。
评估
在 DaCapo、Scalabench 和 Renaissance 的 16 个基准上评估性能与代码大小;4 个基准提升 22%–40%,5 个提升 2.5%–10%,代码大小增长 0.8%–9%,10 个基准增长低于 2.5%。
原文摘要(Abstract)

Availability of profiling information is a major advantage of just-in-time (JIT) compilation. Profiles guide the compilation order and optimizations, thus substantially improving program performance. Ahead-of-time (AOT) compilation can also utilize profiles, obtained during separate profiling runs of the programs. Profiles can be context-sensitive, i.e., each profile entry is associated with a call-stack. To ease profile collection and reduce overheads, many systems collect partially context-sensitive profiles, which record only a call-stack suffix. Despite prior related work, partially context-sensitive profiles have the potential to further improve compiler optimizations. In this article, we describe a novel technique that exploits partially context-sensitive profiles to determine which portions of code are hot and compile them with additional compilation budget. This technique is applicable to most AOT compilers that can access partially context-sensitive profiles, and its goal is to improve program performance without significantly increasing code size. The technique relies on a new hot-code-detection algorithm to reconstruct hot regions based on the partial profiles. The compilation ordering and the inlining of the compiler are modified to exploit the information about the hot code. We formally describe the proposed algorithm and its heuristics and then describe our implementation inside GraalVM Native Image, a state-of-the-art AOT compiler for Java. Evaluation of the proposed technique on 16 benchmarks from DaCapo, Scalabench, and Renaissance suites shows a performance improvement between 22% and 40% on 4 benchmarks, and between 2.5% and 10% on 5 benchmarks. Code-size increase ranges from 0.8%–9%, where 10 benchmarks exhibit an increase of less than 2.5%.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2122,
  title = {Exploiting Partially Context-sensitive Profiles to Improve Performance of Hot Code},
  author = {Maja Vukasovic and Aleksandar Prokopec},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {45},
  number = {4},
  year = {2023},
  doi = {10.1145/3612937}
}