cs.SEJul 7, 2026

Static Metrics Are Insufficient: Predicting Java Method Energy Usage with Execution Time

Authors: Muhammad ImranVincenzo StoicoIvano Malavolta

Organizations: University of L’Aquila, L’Aquila, Italy · Vrije Universiteit Amsterdam, Amsterdam, The Netherlands

Abstract

The increasing energy demand of software systems is raising concerns about their environmental impact and associated costs. Reasoning on energy usage early in the development flow has the potential to significantly reduce the overall energy usage of a software system, as it allows developers to make informed design and refactoring decisions before inefficiencies propagate. However, assessing energy usage without repeated profiling and direct measurement is difficult, which limits early reasoning in practice. This study investigates the limits of method-level energy prediction in Java, examining whether static source code metrics complemented with method-level execution time can estimate the energy consumption of Java methods. We profile 2,786 Java methods to extract 33 static features and measure execution time and energy, then train and compare eleven regression models. Our findings show that static source code metrics alone yield poor predictive performance, with average R2 values close to zero. Incorporating execution time as a lightweight dynamic input significantly improves accuracy, raising R2 to as high as 0.46. Execution time, internal method calls, and cyclomatic complexity consistently emerge as the strongest predictors of energy consumption.

Explore similar work

Jul 6, 2026cs.LG

Beyond the Need for Speed: Energy-Aware Code Generation via Simulation-Guided Reinforcement Learning

Code models strictly prioritize functional correctness, leaving software energy efficiency as an unoptimized byproduct. Training models to generate energy-efficient code requires reproducible feedback at scale, which physical hardware measurement cannot reliably provide due to variance. In this paper, we replace hardware profiling with a deterministic architectural simulation harness to build Green Tea, a corpus of 3.53.5 million evaluations across 1,4741{,}474 C++ problems. We train an energy-aware code model via supervised fine-tuning on energy-contrastive pairs, followed by closed-loop reinforcement learning (GRPO) using simulation-in-the-loop feedback. To rigorously evaluate deployment readiness, we introduce the Correctness-Adjusted Reduction in Energy Total (CARET), a metric that explicitly penalizes code that sacrifices functionality for efficiency. On 143143 held-out problems, our simulation-in-the-loop pipeline achieves 12.63%12.63\% CARET, nearly tripling the gain of fine-tuning alone, and successfully beats the energy efficiency of human-expert references on 58.4%58.4\% of its valid outputs. Furthermore, our analysis exposes the IPC trap: standard throughput proxies like Instructions-Per-Cycle (IPC) actively misrank true energy efficiency on 67.8%67.8\% of problems, proving the absolute necessity of direct energy simulation. By releasing our dataset and infrastructure, we bypass the 263,000263{,}000 CPU-hours required for reproduction, structurally empowering the community to deploy inherently energy-efficient code generation models.
Saurabhsingh Rajput, Tushar Sharma
Apr 27, 2026econ.EM

Energy-Arena: A Dynamic Benchmark for Operational Energy Forecasting

Energy forecasting research faces a persistent comparability gap that makes it difficult to measure consistent progress over time. Reported accuracy gains are often not directly comparable because models are evaluated under study-specific datasets, time periods, information sets, and scoring setups, while widely used benchmarks and competition datasets are typically tied to fixed historical windows. This paper introduces the Energy-Arena, a dynamic benchmarking platform for operational energy time series forecasting that provides a continuously updated reference point as energy systems evolve. The platform operates as an open, API-based submission system and standardizes challenge definitions and submission deadlines aligned with operational constraints. Performance is reported on rolling evaluation windows via persistent leaderboards. By moving from retrospective backtesting to forward-looking benchmarking, the Energy-Arena enforces standardized ex-ante submission and ex-post evaluation, thereby improving transparency by preventing information leakage and retroactive tuning. The platform is publicly available at Energy-Arena.org.
Max Kleinebrahm, Jonathan Berrisch, Philipp Eiser +11
Jun 11, 2026cs.AR

BigPower: Hierarchical Source-Level Module Power Estimation for CPUs with Large Language Models

Accurate power estimation is important for understanding and optimizing CPU power behavior, yet practical workflows often rely on simulation-derived information or post-silicon analysis. In this work, we present BigPower, a hierarchical source-level surrogate model for fine-grained module-level power estimation during CPU design. BigPower leverages large language model-based representations together with architectural hierarchy, module connectivity, configuration parameters, and workload context to estimate module-level power consumption directly from source-level design information, without requiring additional simulation during inference. Experimental results in the open-source XiangShan processor family demonstrate practical fine-grained power estimation across diverse configurations and workloads, offering an efficient alternative to conventional simulation-based workflows.
Honghua Zhu, Chunjie Luo, Jianfeng Zhan