Is there truly a correlation to be found between a developer’s chosen language and their machine’s rate of energy consumption?

Believe it or not, a group of university researchers hailing from Portugal made it a mission to quantify the theory in recent years.

Though modern engineers may be taken aback by what is considered “well-known” in the research paper, the project is extremely documented and thorough in its implementation.


Power v. Speed

The majority of individuals take for granted well-written software that runs faster and consumes less energy. Yet, this harmony may not always be the case, as there is a multitude of factors contributing to the equation of power aside from speed.

The majority of individuals take for granted well-written software that runs faster and consumes less energy. Yet, this harmony may not always be the case, as there is a multitude of factors contributing to the equation of power aside from speed.


The framework

In their publication, the team utilized 10 standard algorithms originating from the Computer Language Benchmarks Game as the foundation for study. This is a free project designed to compare the way a collection of simple algorithms can be used across various popular programming languages.

It serves to calculate the following metrics:

  • The runtime of the user (overall)
  • Memory allocation (peak)
  • The size of the source code when gzipped
  • Total CPU time summed across all threads
  • Individual utilization of CPU
The list of languages supported by the game as well as the study’s findings.

Functional language results were updated in 2020 including benchmarks, results, and data. You can even dissect their entire project. Check out their Github for the latest developments.