Empirical Analysis of Python’s Energy Impact: Evidence from Real Measurements
Computer Science and Information Systems, Tome 22 (2025) no. 3

Voir la notice de l'article provenant de la source Computer Science and Information Systems website

Background: Programming languages provide the notation for writing computer programs capable of granting our devices the desired functionalities. Even though they may seem intangible, the resulting programs involve an amount of energy consumption, which has an impact on the environment. Some studies on the consumption of programming languages indicate that while being one of the most widely used languages, Python is also one of the most demanding in terms of energy consumption. Aims: To provide developers using Python with a set of best practices on how to use it in the most energy-efficient way, this paper presents a study on whether the different ways of programming in Python have an impact on the energy consumption of the resulting programs. Method: We have studied the relationship between Python’s energy consumption and the fact that Python is a very versatile language that allows programs to be compiled and executed in many different ways. Results: From the results obtained in our study, there seems to be a clear relationship between software energy consumption at runtime and: (1) the use of interpreted or compiled Python; (2) the use of dynamically or statically typed variables. Conclusions: Compiling Python code is a good option if it is done using the py compile module. The use of interpreted code seems to decrease energy consumption over compiling using Nuitka. The use of dynamically typed variables seems to decrease considerably the graphics and processor energy consumption. In addition, we have observed that energy consumption is not always directly related to execution time. Sometimes, more power in less time increases consumption, due to the power required.
Keywords: python, efficiency, programming languages, green software
Elisa Jimenez; Alberto Gordillo; Coral Calero; Ma Ángeles Moraga; Félix Garcı́a. Empirical Analysis of Python’s Energy Impact: Evidence from Real Measurements. Computer Science and Information Systems, Tome 22 (2025) no. 3. http://geodesic.mathdoc.fr/item/CSIS_2025_22_3_a3/
@article{CSIS_2025_22_3_a3,
     author = {Elisa Jimenez and Alberto Gordillo and Coral Calero and Ma \'Angeles Moraga and F\'elix Garc{\i}́a},
     title = {Empirical {Analysis} of {Python{\textquoteright}s} {Energy} {Impact:} {Evidence} from {Real} {Measurements}},
     journal = {Computer Science and Information Systems},
     year = {2025},
     volume = {22},
     number = {3},
     url = {http://geodesic.mathdoc.fr/item/CSIS_2025_22_3_a3/}
}
TY  - JOUR
AU  - Elisa Jimenez
AU  - Alberto Gordillo
AU  - Coral Calero
AU  - Ma Ángeles Moraga
AU  - Félix Garcı́a
TI  - Empirical Analysis of Python’s Energy Impact: Evidence from Real Measurements
JO  - Computer Science and Information Systems
PY  - 2025
VL  - 22
IS  - 3
UR  - http://geodesic.mathdoc.fr/item/CSIS_2025_22_3_a3/
ID  - CSIS_2025_22_3_a3
ER  - 
%0 Journal Article
%A Elisa Jimenez
%A Alberto Gordillo
%A Coral Calero
%A Ma Ángeles Moraga
%A Félix Garcı́a
%T Empirical Analysis of Python’s Energy Impact: Evidence from Real Measurements
%J Computer Science and Information Systems
%D 2025
%V 22
%N 3
%U http://geodesic.mathdoc.fr/item/CSIS_2025_22_3_a3/
%F CSIS_2025_22_3_a3