Evaluating the Energy Efficiency of Optimization Techniques in C, Python, and Java
Open Access
- 5 August 2026
- journal article
- research article
- Published by Wiley in Software: Practice and Experience
- Vol. 56 (10) , 1221-1250
Abstract
Background: Software plays a critical role in modern society, but its energy consumption is a growing concern. This issue is especially evident in the Internet of Things (IoT), which involves billions of devices operating under strict energy constraints, most of which rely on C Programming Language (PL) because of its energy efficiency. Outside of IoT, PLs like Python and Java have gained popularity despite being less energy‐efficient, particularly Python. Optimization is therefore essential to reduce energy use in both contexts: (i) in the IoT, where the large number of devices causes high cumulative energy consumption despite using C; and (ii) for Python and Java, given their widespread adoption and higher energy demands. However, software optimizations do not always lead to lower energy consumption. Therefore, their impact on energy efficiency must be evaluated carefully. Method: This article evaluates the energy impact of 26 optimization techniques in C, Python, and Java across different compiler and runtime configurations. The main focus is on comparing baseline and optimized implementations under each configuration. In addition, the study investigates the effect of compiler and runtime settings—such as ‐O0 versus ‐O3 in C, CPython versus Nuitka in Python, and interpreter mode versus Just‐In‐Time (JIT) compilation in Java—applied consistently to both baseline and optimized versions to assess their influence on energy consumption. Results: The results show that Python achieved the best overall improvement, with 58% of the optimization techniques resulting in energy savings, achieving reductions of up to 70.38%. However, despite this high effectiveness in reducing energy consumption, Python still exhibits the highest overall energy consumption among the three PLs.Keywords
This publication has 38 references indexed in Scilit:
- Evaluating Programming Optimization Techniques in C and Python: Impact on Energy Consumption2025
- Impact on energy consumption of design patterns, code smells and refactoring techniques: A systematic mapping studyJournal of Systems and Software, 2024
- On the Energy Consumption of CPython2024
- A Framework for Performance Optimization of Internet of Things Applications2024
- Ranking programming languages by energy efficiencyScience of Computer Programming, 2021
- Multicore processor computing is not energy proportional: An opportunity for bi-objective optimization for energy and performanceApplied Energy, 2020
- Assessing the Sustainability of Software Products—A Method Comparison2019
- Sustainable software products—Towards assessment criteria for resource and energy efficiencyFuture Generation Computer Systems, 2018
- Green in Software Engineering2015
- On the Energy-Performance Tradeoff for Parallel ApplicationsLecture Notes in Computer Science, 2010