
Sustainably reducing CO₂ emissions through efficient software
Interview on the topic of “Green Coding” with Dr. Frank Gredel
The topic of green coding includes a variety of measures that can help to develop software with lower emissions and in a more sustainable manner. What approaches can companies take to actually make the programming of their software “green” with the right coding? What dimensions does this area encompass and what can IT service providers such as PTA IT-Beratung contribute in terms of process model? Dr. Frank Gredel, Head of Business Development at PTA, answers these questions in this interview.
What is behind the concept of green coding?
We all live with the certainty that we must drastically reduce CO₂ production on our planet if we want to preserve it. Decarbonization is the hotly debated buzzword. A fairly new approach to greater sustainability in IT is green coding. After green energy from regenerative sources and green IT, which is primarily concerned with power-saving hardware, green coding ensures greater sustainability in the course of advancing digitization. This involves developing and also operating software sustainably. In application development, this concerns every single line of code, because each line of code can have a huge scaling effect in heavily used software.
And what dimensions are we talking about here?
The dimensions involved are huge. Experts estimate that a Google search releases around 0.2 grams of CO₂. If we wanted to offset the emissions for all the searches we initiate in one year alone by planting trees, we would have to plant around 41 million trees – if we assume that one tree neutralizes around 10 kilograms of CO₂ per year and that there are an estimated 5.6 billion search queries every day. But even that’s a cinch given the 2.2 billion trees we’d have to plant for the 22 million tons of CO₂ that bitcoin mining blows into the atmosphere every year. To give a ratio: In the Black Forest, just four million trees grow on more than 6000 km2.
Against the backdrop of such impressive numbers, there are triggers to look into the issue: What are they?
It is high time to act. We are facing multiple challenges in terms of climate crisis, energy transition, economic efficiency in the wake of increasingly scarce resources. In addition, at the beginning of this year, the EU Taxonomy Regulation came into force, which defines criteria for determining whether an economic activity can be classified as ecologically sustainable. This is now to be supplemented by a new CSR Directive (Corporate Sustainability Reporting Directive), which expands the set of requirements. The first version of the CSR Directive, which has been in force since 2017, already obliges all capital-market-oriented companies and groups with more than 500 employees to also report on non-financial topics.
And yet the topic of green coding doesn’t seem to have really caught on with many of those responsible, why?
Because it is anything but trivial to measure and thus correctly quantify the emissions of software. Software providers usually only calculate the emissions of Scope 1 and Scope 2 factors. Scope 1 emissions result from the direct combustion of fossil materials in the production of a good. Scope 2 emissions have an indirect effect. They arise during production, for example through the purchase of electricity. Scope 3 emissions include all emissions that occur in the supply chain, for example in services provided to customers or in the disposal of end products. Such Scope 3 emissions also occur to a large extent in software, as an internal Microsoft study impressively showed. Scope 3 emissions account for 75 percent of all the company’s emissions, i.e., the production, distribution and use of Windows, Office and cloud products on millions and millions of PCs in the office or at home. That doesn’t make things any easier.
And what does that mean for IT?
The IT sector is currently responsible for four percent of global greenhouse gas emissions, and the trend is rising. By 2040, digital emissions could account for around 14 percent of global CO₂ emissions. As the level of digitization increases, so does the expansion of the IT infrastructure. And the operation of ever larger server farms requires more and more electricity. But we shouldn’t forget the software. That’s why I believe that green IT, i.e. the efficient and economical operation of hardware and data centers, often from the cloud, falls far short here. Because 55 percent of the emissions caused by IT can be influenced by the underlying software. That’s why green coding makes a valuable contribution to achieving climate targets and sustainability.
So where should companies start?
There are three areas in application development that ensure the optimization potential of green coding can be fully realized. The first area concerns the platform being used. Here, it is particularly important to avoid oversizing, to eliminate incorrect configurations and not to disregard hidden infrastructure. The second area covers the logic. This means, for example, that benefit-oriented visual content provides what is wanted more quickly. This increases customer satisfaction and also saves time and energy. However, this also includes consciously using simpler file formats, efficient APIs and optimized image packages, and consistently removing “dead” code from the application, thus establishing zero-waste code. The third area relates to methodology, which should govern that the results that emerge from green coding projects are also reusable across organizations. Agile and lean methodologies prove their worth here, because they facilitate the adaptation of software and increase its efficiency.
Can you outline specific application examples?
In the platform area, for example, it is worth paying attention to which programming language is used at all. There are significant differences here in terms of energy efficiency and speed. Solutions that use C, a very system-oriented language in which the Linux operating system is written, for example, have some of the lowest energy consumption values and are also very fast. The energy optimization of the databases used also plays a role here. For example, an increase in RAM, depending on the query type, leads to power savings of up to 53 percent. And the larger block size resulting from the use of SSDs, ideally combined with FlashDB, also offers great savings potential.
And what about green logic?
Here, too, there is considerable potential for optimization. For example, in rendering. If application developers pay attention to how their programmed data sets are visualized and transformed, energy can be saved, as well as through program code that is developed in such a way that the CPU load is reduced to the necessary minimum. We have even programmed an in-house EnergyBenchmark for this purpose, which shows how high the energy consumption of individual software components is. Another application example is training optimization in AI scenarios. Researchers from Google and the University of Berkeley, for example, found that the use of GPT-3, an autoregressive language model, can save 99.9 percent of CO₂ emissions in this area compared to standard training. A remarkable value.
Finally, let’s look at the third area. What improvements can be achieved in the process model, i.e., the methodology?
Using agile software development for efficient requirements implementation, we can maximize the benefits of IT systems in the sense of green coding. To achieve sustainability, processes, teams and values should be carefully aligned. We live the idea of the Agile Manifesto, which states that we open up better ways of doing application development by doing it ourselves and helping others do it. Specifically, this means that we have extended the agile process model to include green coding approaches, so that we can bring this into our customer projects as a best practice when needed. This allows us to prioritize which requirements we use to optimize the software in terms of energy consumption, sustainability and UX design as early as the product backlog. With the agile approach, we ensure that achieved results are subjected to a detailed sustainability check and adjusted if necessary. After all, we aim to keep getting better, which is why retrospective is also important in our model. After each work cycle, called a sprint, we discuss not only the result of the sprint, but also how we can still improve as a team in the implementation of green coding, so that we also meet the CSR guideline in the final acceptance tests.