7 minute read 26 Feb 2024
Green coding
EY Tech Trends series

Tech Trend 02: Sustainable coding is the need for a greener tomorrow

By Alexy Thomas

EY India Technology Consulting Partner

Technology enthusiast, Data-driven.

7 minute read 26 Feb 2024

Show resources

Software industry must adopt green coding and efficient algorithms to curb rising carbon emissions. 

In brief

  • Sustainable software development involves optimizing code for energy efficiency, utilizing energy-efficient algorithms, and integrating low-power hardware.
  • A key challenge in sustainable coding involves addressing poor coding standards and a lack of knowledge in green software development.
  • Efficient architecture, including optimized cache policies, minimized data exchange, and careful data lifecycle management, plays a crucial role in reducing energy consumption in software design.
  • Green coding principles extend to intelligent workload orchestration, addressing the threat of embedded carbon by efficiently managing workloads and reducing the need for new hardware.

In May 2021, industry giants Microsoft, Thoughtworks, Accenture, and GitHub teamed up with the Joint Development Foundation Projects and The Linux Foundation to launch the Green Software Foundation. This non-profit is laser-focused on building a community for eco-friendly software development. The driving forces? A growing corporate awareness of the energy toll exacted by software development and operation— a pressing concern in our digital space. Until recently, sustainability in software and architectures took a back seat, with many companies mistakenly assuming that, unlike hardware, software did not pose environmental challenges. However, this perception shifted as it became clear that while software does not directly consume energy, poor development practices and its influence on computer hardware significantly impact overall energy consumption and carbon emissions.

As computationally inefficient software drives increased energy consumption, the imperative for green software grows alongside the booming global software market, projected to hit a trillion dollars by 2024 from $825 billion in 2022. IDC states the AI-centric software sector is set to surge with a 30%+ CAGR, reaching $251 billion by 2027. Currently, the Information and Communications Technology (ICT) industry contributes 3.9% to global greenhouse gas emissions, up from 1.6% in 2007, with a predicted 14% share by 2040. Notably, training a single neural network model today emits as much carbon as five cars throughout their lifetimes.

To mitigate emissions, the software industry must transition to sustainable practices, starting with green coding. Sustainable or green coding development is an approach to software engineering that prioritizes energy-efficient patterns and processes throughout the software delivery lifecycle. It involves optimizing code to minimize energy consumption and resource usage, promoting sustainable development practices, and utilizing low-power hardware or energy-efficient infrastructure.

Sustainable software integrates energy-efficient algorithms that execute computing operations more swiftly and effectively than standard software implementing green coding principles reducing application footprint, memory, CPU, network, and data footprint. The benefits of sustainable software extend beyond environmental considerations, including a less complicated architecture, faster computing speeds, and cost savings.

EY India Tech Trends 2024 Series

EY Tech Trends series is a collection of tech resources, wherein each chapter focuses on the rising shifts in key technology areas and their impact across sectors.

Know more

Employing green coding practices

 A significant challenge in sustainable coding lies in poor coding standards and a lack of knowledge in green software development. First and foremost, companies should articulate a green strategy during software development that guides trade-offs and allows for flexibility. This strategy should also include creating new software standards that extend devices' lifecycles, thereby reducing total e-waste.

Developers should adopt application development practices, such as optimizing code, to minimize energy consumption and computation requirements. A thoughtful code base that applies pure functions and limits abstraction layers can reduce overall computation effort. Organizations can implement logic to clean, validate, and aggregate incoming data within the code base to avoid redundant tasks.

Choosing algorithms, programming languages, APIs, and libraries should consider their carbon emissions. Efficient algorithms with linear time complexity and compiled languages like C and C++ are preferable to energy-intensive interpretive languages like Python. For instance, Python takes up as much as 76 times more energy than C. Making AI greener involves developing and using less power-consuming ML models, creating reproducible code, and using specialized hardware optimized for AI workloads.

Monitoring real-time power consumption through dynamic code analysis is crucial for understanding the gaps between design choices and actual energy profiles. From a design perspective, the libraries chosen significantly influence energy efficiency. Organizations should challenge assumptions about end-user expectations and reduce file sizes of text, images, and videos during design.

While many aspects may be beyond the control of individual developers, organizations should embed these principles into their frameworks.

Sustainable architecture and workload management

Properly architecting applications’ energy consumption requires reducing the application footprint and designing with the right architecture. Efficient cache policies, minimized data exchange, and managing the lifecycle of stored data contribute to reducing energy consumption. Running applications in more efficient data centers, powered by recycled or renewable energy, further minimizes the overall carbon footprint.

Green coding principles also involve the intelligent orchestration of workloads. Embedded carbon poses a significant threat, and efficiently managing workloads reduces the need for new hardware. Developers can contribute by implementing instrumentation, measuring the carbon footprint during both application development and deployment, and monitoring real-time energy consumption to identify modules that can be optimized.

Writing energy-efficient software is challenging. It requires a shift in mindset for developers and designers. Achieving progress in sustainability needs action at multiple levels. While developers can reduce carbon emissions by implementing some of the best practises and being aware of the environmental impact of their choices, organizations can make environmental sustainability by having a green coding framework and evaluating its performance based on energy efficiency, alongside traditional parameters. Embracing green software development practices allows developers to make a significant contribution to environmental sustainability, reducing the carbon footprint of software solutions through optimized energy efficiency and resource management, sustainable development practices, and user education. Every step counts in this collective effort. Even single optimization can make a significant impact on the environment.

This podcast series aims to explore the fascinating world of Generative AI Unplugged, its applications, and its impact on various industries. Join us as we dive deep into the realm of artificial intelligence and uncover the innovative techniques used to generate unique and creative outputs.

Know more

EY ESG Compass

EY ESG Compass is a comprehensive digital ecosystem that seeks to help organizations evaluate their ESG maturity levels and adapt a sector-specific strategy, using the power of analytics.

Know more

  • How to measure the carbon intensity of software

    According to Green Software Foundation, to calculate the operational emissions associate with software, multiply the electricity consumption of the hardware the software is running on by the regional, granular marginal emissions rate. The marginal emissions rate reflects the change in emissions associated with a change in demand.

    Testing formula for Sustainability

    SCI  =  (E * I)  +  M  per  R

    Where:

    E = Energy Consumption (kilowatt hours) for different components of the software boundary over a given time period

    I = Emissions Factors – available from GHG Protocol, but should be tracked down to the regional level if possible

    M = Embodied emissions data for servers, laptops and other devices used in the relevant area.

    R = Functional Unit being used (e.g., CO2e; days; etc. )

  • Putting principles into practice

    What you can do

    • Architect: Engineers and architects have to work more closely together to produce the most sustainable code. Architect should choose the best possible framework.
    • Developer: They can control code reuse, select patterns, choose language and how to build CD/CI release trains. Developers can also utilize IDE plugins and other tools to monitor electricity use in real time.
    • Tester: Testing and measuring application software’s carbon intensity at various release and deployment cycles.
    • UX designer: Reimagine every step of the user journey and design process infused with sustainability. User journeys should be under constant review and improvement. 
    • Infra architect: Adopt shared and managed services model to reduce amount of infra needed.
    • DevOps engineer: Should have clear test goals.  Deploy DevOps processes that will support environmental testing in CD/CI cycles, utilizing standard industry.

Summary

As technology adoption continues to accelerate worldwide, the software industry's contribution to global carbon emissions is increasing. To mitigate its environmental impact, the industry needs to embrace sustainable practices, including green coding, the use of energy-efficient algorithms, and low-power hardware. It must address subpar coding standards, and implement a green strategy, guiding trade-offs and setting standards to prolong device lifecycles. Developers play a crucial role in this shift, employing strategies like code optimization and algorithm selection to minimize carbon emissions. With an emphasis on efficient architecture and intelligent workload orchestration, the industry's significance in promoting environmental sustainability becomes apparent.

About this article

By Alexy Thomas

EY India Technology Consulting Partner

Technology enthusiast, Data-driven.