GreenCode: Our Methodology for Energy-Efficient Software

5 min read
GreenCode, Sustainability, Methodology
Share

GreenCode is our methodology for developing energy-efficient software. It emerged from our research into software sustainability, including work with international research consortiums on measuring and reducing the environmental impact of digital services. The methodology is not a separate process that runs alongside development. It is a set of principles and practices embedded into our standard engineering workflow.

The core principle of GreenCode is that energy-efficient software and high-quality software are the same thing. Code that runs fewer CPU cycles, makes fewer memory allocations, and performs fewer I/O operations uses less energy. It also runs faster, costs less to host, and scales more efficiently. When you optimise for energy efficiency, you get performance improvements as a side effect.

Every line of code has an energy cost. GreenCode makes that cost visible and manageable.

Our methodology has four phases. Measurement establishes baseline energy consumption for the application. We use a combination of infrastructure-level metrics from cloud provider dashboards, application-level profiling with tools like Xdebug and py-spy, and our PHP Energy tool for function-level energy measurement. The baseline gives us a reference point against which to measure improvement.

The GreenCode Process

Analysis identifies the highest-impact optimisation opportunities. We follow the 80/20 principle: 80% of energy consumption typically comes from 20% of the code. Usually this is database operations, third-party API calls, and computation-heavy processing. We rank opportunities by potential energy reduction and implementation effort, creating a prioritised backlog of efficiency improvements.

Optimisation implements the identified improvements. Common interventions include database query optimisation, implementation of caching layers, reduction of unnecessary computation, compression of data transfers, and efficient resource lifecycle management. Each optimisation is measured against the baseline to verify the energy reduction. We track cumulative savings across the project.

  • Embed energy efficiency into your standard development workflow, not as a separate process
  • Measure baseline energy consumption before attempting optimisation
  • Focus on the 20% of code that drives 80% of energy consumption
  • Track cumulative energy savings as a project-level metric
  • Monitor for energy regressions alongside performance regressions
  • Include energy efficiency requirements in your definition of done

Monitoring ensures that energy efficiency is maintained over time. New features, dependency updates, and infrastructure changes can all increase energy consumption. We set up dashboards that track energy metrics alongside performance metrics, with alerts for significant regressions. This makes energy efficiency a sustained characteristic of the system rather than a one-time improvement.

Want to Chat?

Contact our friendly team for quick and helpful answers.

Contact us