Energy-efficiency of programming languages
It does not really matter which programming language you use. There are other aspects that are much more important. Especially your runtime environment. For example, if you are using Java (or another language running on the JVM), optimize the JVM, choose a lightweight framework and optimize your database queries. in real-world scenarios. See also Optimization of Java Applications – CPU Usage, Memory Usage, Startup Time, Resource Efficiency.
Aspects to consider
Aspects to consider when comparing the energy-efficiency of programming languages
🔗 References
Kempen at al. (2024)
It's Not Easy Being Green: On the Energy Efficiency of Programming Languages
Source code: https://github.com/nicovank/Energy-Languages
Discussions:
Conclusions:
- Energy usage is purely the product of how long a program runs → faster languages / language implementations will consume less energy than slower ones
- Language is not the deciding point, what's matter is their implementation and their runtime behavior
- What to do? Use different language implementations, use different libraries, optimize your own code, etc.
Green Coding Solutions
Energy Efficiency of programming languages - Revisiting Python in 2024 | green-coding.io
Conclusions:
- Performance / Energy efficiency of the Python interpreter has improved significantly from Python 3.9 to Python 3.12
- Using PyPy (different Python implementation with JIT) is much more performant and energy efficient than Python. PyPy is 50 % more energy efficient than Python 3.12.
Pereira et al. (2017, 2021)
HPI clean-IT openXchange Live Talk – Energy efficiency of programming languages (João Saraiva)
What Are the Greenest Programming Languages? | by Kesk | Medium
Main issues with the study:
- theoretical benchmarks (cpu-bound) were used that are not representative for practice
- Focus on programming language instead of language/runtime implementation