Static Metrics Are Insufficient: Predicting Java Method Energy Usage with Execution Time
- URL: http://arxiv.org/abs/2607.06124v1
- Date: Tue, 07 Jul 2026 10:35:24 GMT
- Title: Static Metrics Are Insufficient: Predicting Java Method Energy Usage with Execution Time
- Abstract summary: Reasoning on energy usage early in the development flow has the potential to significantly reduce the overall energy usage of a software system.<n>Assessing energy usage without repeated profiling and direct measurement is difficult.<n>This study investigates the limits of method-level energy prediction in Java.
- Score: 4.1759895896406904
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- 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.
Related papers
- Developer Attitudes and Practices Towards Optimizing Software Energy Consumption [9.378911615939925]
Energy consumption is explicitly considered in only a minority of projects.<n>More commonly, developers influence energy use indirectly by optimizing proxy properties such as execution time and CPU utilization.<n>We identify organizational disincentives, limited tooling, and educational gaps as major barriers to adoption.
arXiv Detail & Related papers (2026-08-31T09:57:36Z) - Beyond FLOPs: Energy-Aware Knowledge Distillation for Sustainable LLMs on Code-Related Task [10.915684166086026]
Large Language Models (LLMs) are increasingly being applied to Software Engineering (SE) tasks, achieving high accuracy across problems such as clone detection, vulnerability prediction, and code summarization.<n>High computational demands and energy consumption raise sustainability concerns and hinder their use on consumer hardware and resource-constrained platforms.<n>This paper investigates the implications of energy-aware knowledge distillation for SE, aiming to improve model efficiency while maintaining performance.
arXiv Detail & Related papers (2026-08-18T08:41:04Z) - EnCoDe: Energy Estimation of Source Code At Design-Time [0.0]
Energy efficiency has emerged as a vital attribute of software quality, with significant implications for both environmental sustainability and operational costs.<n>Existing profiling tools operate only at runtime and coarse granularity, typically capturing energy at the process or method level.<n>We propose EnCoDe, a methodology for fine-grained, design-time energy estimation.
arXiv Detail & Related papers (2026-05-01T08:30:36Z) - Babbling Suppression: Making LLMs Greener One Token at a Time [46.879983975894135]
Large Language Models (LLMs) are increasingly used in modern software development.<n>LLMs produce extraneous output, referred to as "babbling", which incurs additional cognitive, economic, and energy costs.<n>This work proposes a practical, model-agnostic approach to reduce unnecessary output without compromising solution accuracy.
arXiv Detail & Related papers (2026-04-08T07:21:02Z) - An Initial Exploration of Contrastive Prompt Tuning to Generate Energy-Efficient Code [46.879983975894135]
This study aims to investigate whether and how LLMs can be optimized to promote the generation of energy-efficient code.<n>CPT combines Contrastive Learning techniques, which help the model to distinguish between efficient and inefficient code.<n>This study evaluates CPT on Python, Java and C++ coding problems across three different models to provide a comprehensive evaluation.
arXiv Detail & Related papers (2026-03-03T12:36:15Z) - ODAR: Principled Adaptive Routing for LLM Reasoning via Active Inference [60.958331943869126]
ODAR-Expert is an adaptive routing framework that optimize the accuracy-efficiency trade-off via principled resource allocation.<n>We show strong and consistent gains, including 98.2% accuracy on MATH and 54.8% on Humanity's Last Exam.
arXiv Detail & Related papers (2026-02-27T05:22:01Z) - Towards Green AI: Decoding the Energy of LLM Inference in Software Development [46.879983975894135]
AI-assisted tools are increasingly integrated into software development, but their reliance on large language models (LLMs) introduces substantial computational and energy costs.<n>We conduct a phase-level analysis of LLM inference energy consumption, distinguishing between the (1) prefill, where the model processes the input and builds internal representations, and (2) decoding, where output tokens are generated using the stored state.
arXiv Detail & Related papers (2026-02-05T14:38:19Z) - Probabilistic energy profiler for statically typed JVM-based programming languages [1.7842332554022688]
Energy consumption is a growing concern in several fields, from mobile devices to large data centers.<n>Previous approaches have a broader focus, such as on specific functions or programs, rather than source code statements.<n>We develop a novel methodology to address the limitations of measuring only the consumption and using point estimates.
arXiv Detail & Related papers (2025-12-02T13:21:35Z) - Seer Self-Consistency: Advance Budget Estimation for Adaptive Test-Time Scaling [55.026048429595384]
Test-time scaling improves the inference performance of Large Language Models (LLMs) but also incurs substantial computational costs.<n>We propose SeerSC, a dynamic self-consistency framework that simultaneously improves token efficiency and latency.
arXiv Detail & Related papers (2025-11-12T13:57:43Z) - The Fast for the Curious: How to accelerate fault-tolerant quantum applications [101.46859364118622]
We evaluate strategies for reducing the run time of fault-tolerant quantum computations.<n>We discuss how the co-design of hardware, fault tolerance, and algorithmic subroutines can reduce run times.
arXiv Detail & Related papers (2025-10-30T02:27:55Z) - Temporal Encoding Strategies for Energy Time Series Prediction [0.0]
This work proposes a novel approach to enhance the accuracy of predictive models by employing sinusoidal encoding on periodic features of time-series data.<n>Several statistical and ensemble machine learning models were trained on an energy demand dataset, using the proposed sinusoidal encoding.<n>Results demonstrated a 12.6% improvement of Root Mean Squared Error and a 7.8% increase in the R2 score.
arXiv Detail & Related papers (2025-03-19T17:36:53Z) - Impact of ML Optimization Tactics on Greener Pre-Trained ML Models [46.78148962732881]
This study aims to (i) analyze image classification datasets and pre-trained models, (ii) improve inference efficiency by comparing optimized and non-optimized models, and (iii) assess the economic impact of the optimizations.
We conduct a controlled experiment to evaluate the impact of various PyTorch optimization techniques (dynamic quantization, torch.compile, local pruning, and global pruning) to 42 Hugging Face models for image classification.
Dynamic quantization demonstrates significant reductions in inference time and energy consumption, making it highly suitable for large-scale systems.
arXiv Detail & Related papers (2024-09-19T16:23:03Z) - Normalizing Energy Consumption for Hardware-Independent Evaluation [9.658615045493734]
We present a novel methodology for normalizing energy consumption across different hardware platforms.
Our approach shows that the number of reference points, the type of regression and the inclusion of computational metrics significantly influences the normalization process.
arXiv Detail & Related papers (2024-09-09T13:38:00Z) - Energy-Efficient Scheduling with Predictions [4.662349748983561]
In energy-efficient scheduling, the operating system controls the speed at which a machine is processing jobs.
Recent work on learning-augmented algorithms aims to achieve improved performance guarantees by leveraging predictions.
We provide a flexible learning-augmented algorithmic framework that takes as input an offline and an online algorithm for the desired energy-efficient scheduling problem.
arXiv Detail & Related papers (2024-02-27T02:13:32Z) - Multi-Agent Meta-Reinforcement Learning for Self-Powered and Sustainable
Edge Computing Systems [87.4519172058185]
An effective energy dispatch mechanism for self-powered wireless networks with edge computing capabilities is studied.
A novel multi-agent meta-reinforcement learning (MAMRL) framework is proposed to solve the formulated problem.
Experimental results show that the proposed MAMRL model can reduce up to 11% non-renewable energy usage and by 22.4% the energy cost.
arXiv Detail & Related papers (2020-02-20T04:58:07Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.