Search papers, labs, and topics across Lattice.
This study evaluates the effectiveness of static source code metrics and execution time in predicting energy consumption for Java methods, addressing the challenge of assessing energy usage early in the development process. By profiling 2,786 Java methods and extracting 33 static features, the research reveals that static metrics alone yield negligible predictive performance, while incorporating execution time as a dynamic input significantly enhances accuracy, achieving R2 values up to 0.46. Key predictors identified include execution time, internal method calls, and cyclomatic complexity, suggesting a more nuanced approach to energy estimation in software development.
Static metrics fall flat in predicting Java method energy usage, but adding execution time boosts accuracy significantly鈥攗p to 0.46 R2.
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.