Principals of Green Computing


These principles can be used by software development teams to help build better code. They don’t require any specialist tools or expense and can be applied to any type of software.

Architecture

  1. Guarantee maintainability through the structure and configuration of the software and not through consuming extra data at runtime.
  2. Object-orientated software architecture based on SOLID principals and GO4 patterns, still provides the best structure to easily extend any software with minimal impact on the overall system.
  3. Having additional code within your reusable library uses much less energy than having data at runtime which consumes system resources.

Development

  1. It’s not just about the energy consumption of running software, it also about how much is consumed while managing, operating, developing, testing and maintaining the software.
  2. Don’t let others, platforms or runtimes clean up after you, instead do it yourself and make sure all your resources are released as soon as you’ve finished with them, (pipes, sockets, memory, I/O, etc). This will reduce the amount of CPU and memory that are used to manage these resources increasing performance and space for other applications to work.
  3. Narrow variables and multiplexed data types in contracts and in databases will reduce storage requirements and the energy usage to maintain and transmit the data.

Infrastructure

  1. Only store what data is needed. Data is stored on discs that defragment and that use compression to save space. Compressing and decompressing use considerable CPU cycles, expending energy and requiring RAM. Overusing RAM requires swapping to the hard disk.
  2. Use memory wisely and leverage the features of the platform, operating system, and hardware where appropriate. Accessing data held in level 1 CPU cache is far more efficient than fragmented RAM swapped onto the hard disk.
  3. Do we need to use the latest fastest and hungriest hardware? Can we target old devices or the hardware platform itself?

Agility

  1. Development and testing of software expends time and energy, only develop what needs to be developed, only test what has been impacted and reduce the impact as much as possible.
  2. Act to reduce wastage throughout the development lifecycle by measuring value and output at every point.
  3. Shifting left promotes sustainability.
    1. Shift left testing into unit level, testing only what is needed.
    2. Testing changes rather than full regression sets.
    3. SAST rather than DAST.
    4. Proper requirements engineering over software design over coding.

.