Green code and green IT

Digitalization and software have made our lives easier and made our operations many times more efficient over the past decades. Data centers consume two to three percent of the planet’s total electricity usage now. It has considerable CO2 footprint. Various ICT solutions are responsible for 4–10 percent of annual electricity consumption and 3–5 percent of global greenhouse emissions (ICT industry climate and environmental strategy, 2021).

By one estimate, consumption could jump to as much as 13 percent of the world’s total electricity demand by 2030. Everyone seems to be slowly convinced of the existence of climate change and the necessity of reacting to it. Climate change and the prevailing energy crisis in today’s world force us to examine all energy consumption. The ICT sector must also participate in ways to save energy, because all information processing, presentation and transfer consumes energy.

Technology for massive reductions in environmental footprint already exists – many try to optimize data centers PAU with different approaces and cleaner power generation. Green Data: The Next Step to Zero-Emissions Data Centers article mentions that as cloud computing becomes more energy efficient and increasingly relies on renewable sources it can help. The data center industry needs to think about this. Some players already do that.

But can coders help in making IT industry more green? Does anyone talk about writing greener software instead of bloatware? Does anyone talk to think that the features and all the processing of data makes sense?

Earlier as the speed of devices has continuously increased, it has been possible to implement software without worrying about efficiency. And while software grows in size, so does the amount of energy they consume. Software already reduces emissions by streamlining or optimizing other operations. This is called a carbon fingerprint. The IT industry has reduced unnecessary intermediate steps in processes or minimized the use of paper and printing. However, it cannot justify the inefficiency of the software and the growing energy consumption.

Yes, there is talking on going on green code and green IT more on last few years. It is not always clear how each of us can influence the matter. Software development is an excellent example of an industry where the climate impact of work can vary greatly depending on work methods. The same end result can be achieved either climate-wise way or by using bloatware that causes a large climate burden. The same end results can can be often achieved efficiently or ineffectively, in which case it is smart from the point of view of the Earth to choose an efficient implementation.

There is a lot of reckless data usage. The computing, storage and data transfer capacity of digital devices have developed in a way that no other field of technology has been able to do. Massive data transfer in use nowadays means massive extra energy consumption. In the fiber backbone network, to which the computer is often connected, the energy consumption of the transmitted bit is still reasonable. On the other hand, the mobile network clearly consumes more energy to transfer a bit, up to a thousand times more per bit. Why should smartphones be capable of computing at the level of supercomputers, when they mainly use various social media services or play games? Of course, there is a need for graphics for a better user experience, and because of ads, the pages are free for their users. Overall, however, the number of ads and graphics is far too large and poorly optimized.

It is clear that, on average, various websites have way too much data behind them. The kind of data that consumes a lot of energy, but often does not provide exceptional added value from the user’s point of view. In last 10 years the the typical size of web pages created for computers has increased by 500 percent and for mobile devices by more than 1000 percent. As a result, the size of a typical page for both mobile devices and computers is the same, around 2 megabytes. So what does this mean in practice? Overload and massive energy consumption: The data must first be stored on servers, transferred over the data network and processed in the terminal devices. The data is also typically disposable, i.e. it is loaded again when the website is visited later. And much of this data transfer is unnecessary. Optimizing websites can be done. These savings can be up to 50 percent of the traffic caused by the service. In some cases, it is possible to achieve savings of 90 percent, so that the end user does not see any difference. Many online stores have already noticed that the optimized pages work faster for the users, and that the faster their business is, the better their turnover is. If optimization starts to be done more widely, the consequences could be downright revolutionary.

In software development, highly automated processes are available in cloud services, data transfer and SaaS products. Unfortunately, this mode of operation – at least in its current form – limits our visibility to both our energy consumption and climate emissions. We need to gain knowledge how much much your systems consumes and why. In addition to knowledge, we must also have a view of the meaning of knowledge. A climate-wise coder needs a feel for key quantities. If our server consumes a kilowatt-hour of energy, is it a lot or a little?

Fortunately, research and discussion about the climate impacts of the ICT sector has already started and gained good momentum a few years ago. In Finland, it has been investigated e.g. in TIEKE ry’s Green ICT project (2021-2023), in which they promoted lower-carbon digital service production and climate-wise procurement expertise of companies and the public sector in the Uusimaa region in Finland.

Their web pages give information how to move forward on green IT. The project estimated that in many cases the footprint of an individual ICT service can be reduced by up to 90 percent with the right measures.

It is possible to minimize the inefficiency of the software using the so-called with green coding. Green code is an attitude or thought model towards coding, which results in optimized and resource-efficient code. At the same time, it should maximize value and minimize energy consumption. The opposite of green code is waste – energy-consuming activities that do not produce value. Green coding especially affects energy consumption. It aims to minimize both the time spent on data processing and the amount of data transferred, because both of them consume energy and cause climate emissions. Sustainable software engineering is better for the environment and can help a business’s bottom line. Those working in software development should think more about the carbon footprint of the lines of code they write.

Janne Kalliola has written an excellent book, Vihreä Koodi / Green Code that covers the topic what is green code. Green IT and code have already been talked about quite a lot in Finland over the past year. More software companies have started to talk about green coding, and to promote it. However, it has not yet been defined what the green code or eco-efficient systems are. The purpose of the book is not to unequivocally define green code and create a canon. Instead, the idea is to focus on describing patterns to stimulate thinking and presenting various solutions. By using these, anyone working on the matter can analyse their situation and identify the changes they need to make to become more environmentally friendly.

The Green Code book offers insights on the following topics:

  • Why should code be green?
  • The energy consumption of software
  • Raiders of the lost efficiency
  • Solutions on tackling lost efficiency
  • Concrete recommendations for the main stakeholders involved in green software development, all the way from software developers to end-users

The second extended edition of the book also offers insights into the energy dynamics of AI, data usage, cryptocurrencies and the internet of things (IoT), while highlighting actionable strategies for sustainable growth.

The book is available in English with name Green Code at
https://www.exove.com/green-code/

You can download the original Vihreä Koodi in Finnish language at
https://www.exove.com/fi/vihrea-koodi/

Links to sources:
TIEKE ry’s Green ICT project
https://www.codeo.fi/blogi/vihrea-ict/
https://www.epanorama.net/newepa/2012/04/18/how-clean-is-your-cloud-and-telecom/
https://www.exove.com/fi/vihrea-koodi/
https://www.exove.com/green-code/
https://punamusta.com/asiantuntija/vihrea-koodi-on-tulevaisuuden-itta/
Sustainable Software Engineering – What Is It And What You Need To Know
https://www.mustread.fi/artikkelit/ratkaisu-on-vihrea-koodi-monet-digitaaliset-palvelut-on-suunniteltu-huonosti-ja-ne-vievat-valtavasti-energiaa/
https://www.sytyke.org/kestava-kehitys/vihrea-koodi/
https://www.greencode.world/
https://www.cgi.com/fi/fi/blogi/mita-green-coding-on
https://blog.digia.com/green-code-energiaviisaampia-ratkaisuja-asiakkaitamme-ja-tulevaisuuttamme-varten