paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CodeGreen: Towards Improving Precision and Portability in Software Energy Measurement

CodeGreen:提升软件能耗测量的精度与可移植性
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 3/10 · 该论文关注软件能耗测量工具,使用AST插桩实现跨平台测量,属于程序分析与开发者工具,但与用户核心关注的PL与AI/LLM交叉、浮点程序分析、贝叶斯程序分析等方向无直接关联。引用 1 inbox
Saurabhsingh Rajput, Tushar Sharma
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出模块化能耗测量平台 CodeGreen,以异步解耦架构与 AST 自动插桩实现高精度、跨平台、低开销的软件能耗测量。

现有软件能耗分析工具因与特定硬件或语言紧耦合,不得不在测量精度与开销之间权衡。CodeGreen 是模块化能耗测量平台,用异步生产者—消费者架构将插桩与测量解耦:原生能耗测量后端(NEMB)独立轮询 Intel RAPL、NVIDIA NVML、AMD ROCm 等硬件传感器,轻量时间戳标记提供可调粒度。它借助 Tree-sitter AST 查询为 Python、C++、C 和 Java 自动插桩,并可扩展到其他 Tree-sitter 语法,自动定位循环、方法、类等作用域。在 Computer Language Benchmarks Game 上验证,与 RAPL 基准真值的相关系数 R²=0.9934,能耗—工作负载线性度 R²=0.9997,兼顾细粒度精度与跨平台可移植性。

问题
现有软件能耗剖析器因与特定硬件或语言紧耦合,难以同时兼顾测量精度、低开销与跨平台可移植性。
方法
采用异步生产者—消费者架构将插桩与测量解耦,NEMB 独立轮询硬件传感器,并以轻量时间戳标记提供可调粒度;利用 Tree-sitter AST 查询实现多语言自动插桩与作用域定位。
评估
在 Computer Language Benchmarks Game 上评测,与 RAPL 基准真值相关性 R²=0.9934,能耗—工作负载线性度 R²=0.9997。
原文摘要(Abstract)

Accurate software energy measurement is critical for optimizing energy, yet existing profilers force a trade-off between measurement accuracy and overhead due to tight coupling with supported specific hardware or languages. We present CodeGreen, a modular energy measurement platform that decouples instrumentation from measurement via an asynchronous producer-consumer architecture. We implement a Native Energy Measurement Backend (NEMB) that polls hardware sensors (Intel RAPL, NVIDIA NVML, AMD ROCm) independently, while lightweight timestamp markers enable tunable granularity. CodeGreen leverages Tree-sitter AST queries for automated instrumentation across Python, C++, C, and Java, with straightforward extension to any Tree-sitter-supported grammar, enabling developers to target specific scopes (loops, methods, classes) without manual intervention. Validation against Computer Language Benchmarks Game demonstrates R2 = 0.9934 correlation with RAPL ground truth and R2 = 0.9997 energy-workload linearity. By bridging fine-grained measurement precision with cross-platform portability, CodeGreen enables practical algorithmic energy optimization across heterogeneous environments. Source code, video demo, and documentation are publicly available [18].

链接与引用

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

BibTeX
@inproceedings{abs-2603-17924,
  title = {CodeGreen: Towards Improving Precision and Portability in Software Energy Measurement},
  author = {Saurabhsingh Rajput and Tushar Sharma},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3806429}
}