Red Dot Creations Logo

Red Dot Creations

Copyright © 2021 Red Dot Creations - All rights reserved

Red Dot Creations Logo

27 Old Gloucester Street
London WC1N 3AX
Phone: +44 7500770328

Red Dot Creations

Privacy        Cookies

Programming languages ​​and energy consumption

25 Nov 2021 | News

Red Dot Creations

Which programming languages ​​consume the most energy? Some researchers have obtained interesting results.

In recent years, we often hear of the need to give greater emphasis to problems related to energy consumption . In the IT sector, it has often been heard of in relation to mobile devices, making it almost a problem of usability and general user experience of the device.

Lately, however, the meaning of this problem seems to have returned to approach much more consistent problems. The explosion of machine learning , cryptocurrencies and the new digital gold rush ( cryptomining ) have prompted developers, systems engineers and stakeholders to consider the problem more generally. Reducing energy consumption also means fighting climate change.

Energy consumption and programming languages

It is therefore no coincidence that a team of Portuguese university researchers attempted to quantify the energy efficiency of different programming languages, summarizing the results of this research in an article entitled Energy Efficiency across Programming Languages , in which the runtimes, memory usage and power consumption of twenty-seven well-known programming languages.

Without too much surprise, C turned out to be the clear winner, while Python (one of the most popular languages ​​for machine learning and cryptomining problems, mentioned above) is leading the way, along with Perl .

The study explains that compiled languages ​​tend to be faster and more energy efficient. C and C ++ are therefore among the best, while Go was found to be the worst of the compiled languages, even worse than Java or Erlang, although they need a virtual machine to run.


energy consumption

No wonder too much that the worst languages ​​in terms of energy efficiency are precisely those interpreted. At the same time, in considering Python (which is perhaps the most significant, considering also its wide adoption in recent times), it must be said that there are several implementations of Python interpreters optimized for specific platforms. Considering that the tests carried out for the study in objects were performed on a machine with Intel Core i5-4460 Haswell @ 3.20 GHz CPU, with 16 GB of RAM and with Ubuntu Server operating system16.10, it is to be expected that the results may vary on other platforms. For example, MicroPyhon is now running on a wide range of microcontrollers, and could be much more efficient than the results obtained by the Portuguese researchers represent.

No wonder

All in all, these results are in line with what the researchers themselves originally predicted. The need to interpret the code indicates a greater computational overhead, and therefore an inevitable greater energy consumption. However, it is interesting to note that, within the same categories of languages, there are rather significant differences which, in some contexts, it is good to take into consideration.

Source: HTML

Red Dot Creations