SSJX.CO.UK
Content

Greener Software

By using some of the tips on this site, you should be able to make your programs and websites a little more efficient. In this instance, efficient means they are doing the same task but taking less time to do it and / or using fewer resources (CPU cycles / storage space).

Microsoft has many articles about how moving some of their services from Dot Net Framework to Dot Net Core/5+ has massively increased their performance. At Microsoft's scale, if they can double the speed of a service, that means they effectively half their running costs which in turn reduces their need for so many server warehouses.

A study "Energy Efficiency Across Programming Languages." did as the name suggests, they did a variety of tests across many programming languages to see which were the most efficient in terms of energy and time used. Although the results should be taken with a pinch of salt, the general outcome was that many scripting / interpreted languages did very poorly. The results table for the energy used showed the following:

PositionLanguageEnergy
1C1
2Rust1.03
5Java1.98
13C#3.14
14Go3.23
26Python75.88
27 (last)Perl79.58

The above cherry picked listed shows that on average, Perl used 79 times more energy than the C version. Although converting everything to C is not recommended, it shows that even moving to a language that is not at the top of the list (e.g. C# / Go) could still make a massive difference. Other factors do need to be considered but depending on the problem being solved, moving to another language is probably worth investigating.

Some of the memory saving tips on this site and in the guide may not seem that groundbreaking, but if a server is running many small programs and each of them is being a little bit wasteful, it soon adds up.

Updated
(31/08/2023)