Python Under the Microscope: A Comparative Energy Analysis of Execution Methods

As environmental awareness grows and the world heads toward carbon neutrality, the energy efficiency of software systems has become an increasingly major topic of research. Python, known for its readability and vast ecosystem, is widely used in many domains, from data science to back-end development, despite ongoing concerns about its execution speed and energy consumption. Although there are various optimization methods and alternative interpreters available for Python, there still remains a lack of indepth research directly comparing their runtime performance and energy efficiency. To bridge this gap, our research has evaluated five widely used Python execution approaches: standard interpretation with CPython, ahead-of-time compilation through Cython, just-in-time compilation using PyPy, bytecode compilation via py_compile, and the foreign function interface method using ctypes. Using 15 benchmark algorithms adapted from the Computer Language Benchmarks Game and a suite of software profiling tools, we introduced GreenScore—a composite metric that integrates normalized carbon emissions, execution time, and energy consumption. Our findings reveal that FFI-based execution through ctypes achieved the best results, with the lowest energy use (17.9 J), fastest runtime (2.88 s) and smallest carbon footprint (0.009 gCO2eq), outperforming the CPython baseline. PyPy and Cython also performed well, whereas py_compile offered minimal improvement. To ensure the robustness and reliability of these findings, statistical significance testing, standard deviation analysis, and both real and synthetic survey-based validations were conducted. These validations reinforce the consistency and practical credibility of the results, offering actionable insights for developing energy-efficient and sustainable Python applications.

Authors

Institutions

Publication Details

Journal
IEEE Access
Published
2025-01-01
DOI
https://doi.org/10.1109/access.2025.3630507
Primary Topic
Green IT and Sustainability
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Python Under the Microscope: A Comparative Energy Analysis of Execution Methods

Md. Naimur Rahman, Md. Abdul Hakim Khan, Md. Motaharul Islam, Md. Mahmudul Hasan et al.
IEEE Access
Green IT and Sustainability
article

Python Under the Microscope: A Comparative Energy Analysis of Execution Methods

Md. Naimur Rahman, Md. Abdul Hakim Khan, Md. Motaharul Islam, Md. Mahmudul Hasan, Sabbir Ahmed, Md. Fatin Shadab Turja, Adiba Irin
article en

Abstract

As environmental awareness grows and the world heads toward carbon neutrality, the energy efficiency of software systems has become an increasingly major topic of research. Python, known for its readability and vast ecosystem, is widely used in many domains, from data science to back-end development, despite ongoing concerns about its execution speed and energy consumption. Although there are various optimization methods and alternative interpreters available for Python, there still remains a lack of indepth research directly comparing their runtime performance and energy efficiency. To bridge this gap, our research has evaluated five widely used Python execution approaches: standard interpretation with CPython, ahead-of-time compilation through Cython, just-in-time compilation using PyPy, bytecode compilation via py_compile, and the foreign function interface method using ctypes. Using 15 benchmark algorithms adapted from the Computer Language Benchmarks Game and a suite of software profiling tools, we introduced GreenScore—a composite metric that integrates normalized carbon emissions, execution time, and energy consumption. Our findings reveal that FFI-based execution through ctypes achieved the best results, with the lowest energy use (17.9 J), fastest runtime (2.88 s) and smallest carbon footprint (0.009 gCO2eq), outperforming the CPython baseline. PyPy and Cython also performed well, whereas py_compile offered minimal improvement. To ensure the robustness and reliability of these findings, statistical significance testing, standard deviation analysis, and both real and synthetic survey-based validations were conducted. These validations reinforce the consistency and practical credibility of the results, offering actionable insights for developing energy-efficient and sustainable Python applications.

IEEE AccessVol. 13
Dhaka International University (BD), United International University (BD)
Openalex Percentile: Top 67%
Green IT and Sustainability
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.