CodeGreen: Towards Improving Precision and Portability in Software Energy Measurement
Saurabhsingh Rajput, Tushar Sharma

TL;DR
CodeGreen is a modular, cross-platform energy measurement platform that decouples instrumentation from measurement, enabling precise, portable, and automated energy profiling across multiple programming languages and hardware sensors.
Contribution
It introduces a decoupled, asynchronous architecture with automated instrumentation using Tree-sitter, allowing accurate and portable energy measurement across diverse hardware and languages.
Findings
High correlation with ground truth (R^2=0.9934)
Near-perfect linearity with energy workload (R^2=0.9997)
Supports multiple hardware sensors and programming languages
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsGreen IT and Sustainability · Parallel Computing and Optimization Techniques · Big Data and Digital Economy
