Evaluating Programming Optimization Techniques in C and Python: Impact on Energy Consumption
摘要
Software plays a critical role in modern society, but its energy consumption is a growing concern. The Internet of Things (IoT) exemplifies this challenge, with billions of devices relying on C for energy efficiency. Outside the IoT domain, Python is becoming increasingly popular despite being one of the least energy-efficient programming languages (PLs). Optimization is therefore essential to reduce energy consumption in both cases: (i) in the IoT, where despite the use of C, the large number of devices leads to high energy consumption, and (ii) in Python, due to its high energy consumption. This paper evaluates 23 optimization techniques in C and Python, taking into account the choice of compiler (O0/O3 in C and Interpreter/Nuitka in Python). The results show that more techniques have a positive impact (reducing energy) in Python than in C, but the energy consumption of Python remains significantly higher, requiring further optimizations to narrow the gap.