Who Wins the Race? (R Vs Python) - An Exploratory Study on Energy Consumption of Machine Learning Algorithms

📅 2025-08-24
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
The environmental impact of programming language choice on AI energy consumption remains underexplored, particularly across training and inference phases. Method: This study conducts the first systematic, empirical comparison of energy consumption between Python and R for machine learning, using standardized hardware and direct power measurement. We evaluate five regression and five classification algorithms under reproducible conditions, concurrently logging execution time and real-time power draw. Contribution/Results: Language selection induces energy differences of up to 99.16%; 95% of test cases exhibit statistically significant energy disparities (p < 0.05), with the more efficient language varying by task type. These findings establish programming language as a critical, previously overlooked software-level factor influencing AI’s carbon footprint. The work provides empirically grounded, actionable guidance for sustainable language selection in green machine learning practice.

Technology Category

Application Category

📝 Abstract
The utilization of Machine Learning (ML) in contemporary software systems is extensive and continually expanding. However, its usage is energy-intensive, contributing to increased carbon emissions and demanding significant resources. While numerous studies examine the performance and accuracy of ML, only a limited few focus on its environmental aspects, particularly energy consumption. In addition, despite emerging efforts to compare energy consumption across various programming languages for specific algorithms and tasks, there remains a gap specifically in comparing these languages for ML-based tasks. This paper aims to raise awareness of the energy costs associated with employing different programming languages for ML model training and inference. Through this empirical study, we measure and compare the energy consumption along with run-time performance of five regression and five classification tasks implemented in Python and R, the two most popular programming languages in this context. Our study results reveal a statistically significant difference in costs between the two languages in 95% of the cases examined. Furthermore, our analysis demonstrates that the choice of programming language can influence energy efficiency significantly, up to 99.16% during model training and up to 99.8% during inferences, for a given ML task.
Problem

Research questions and friction points this paper is trying to address.

Compares energy consumption of ML algorithms in R and Python
Evaluates programming language impact on ML energy efficiency
Measures runtime performance and energy costs for training and inference
Innovation

Methods, ideas, or system contributions that make the work stand out.

Compares Python and R energy consumption
Measures ML training and inference efficiency
Analyzes statistical differences in energy costs
🔎 Similar Papers
No similar papers found.
R
Rajrupa Chattaraj
Research in Intelligent Software & Human Analytics (RISHA) Lab, Department of Computer Science & Engineering, Indian Institute of Technology Tirupati, India
Sridhar Chimalakonda
Sridhar Chimalakonda
Research in Intelligent Software & Human Analytics (RISHA) Lab, Department of Computer Science & Engineering, Indian Institute of Technology Tirupati, India
V
Vibhu Saujanya Sharma
Accenture Labs, India
Vikrant Kaulgud
Vikrant Kaulgud
Accenture Labs
Software EngineeringSustainabilityCloudHuman Centered SoftwareDigital