Environmental sustainability for computational research

What can Bioconductor developers do?

Liz Ing-Simmons

Environmental impacts of computing

Graph showing an increase in global data centre energy usage from around 250 TWh in 2020 to around 400 TWh in 2024, and a steeper predicted increase up to almost 1000 TWh in 2030 Artwork by Dillon Marsh, showing a photo of a copper mine containing a realistic CGI ball of copper. Photograph of a river feeding into a reservoir, with a low water level that reveals an old stone bridge in addition to a modern bridge. Close-up photograph of electronic waste on the ground, including a computer mouse several and broken circuit boards.

What can we do?

Diagram with the text 'Green software principles' above and the three principles illustrated below. 'Energy efficiency' is illustrated with a battery-like diagram, 'Hardware efficiency' with a computer-like diagrm, and 'Carbon awareness' is illustrated with a small bar chart, with one dark grey bar labelled 'CO2', and a larger green bar. The diagram also includes the Green Software Foundation logo.

Sufficiency: do the minimal amount of computing required

Developer workflow

  • Sufficiency
    • Minimal examples
    • Minimal CI workflows
    • Efficient use of AI coding assistants
  • Carbon awareness
    • Choose a resource or region with green electricity

User-facing code

  • Hardware efficiency
    • Memory usage
    • Appropriate HPC/cloud resource requests
  • Energy efficiency
    • Code optimisation

Code profiling

Where are the bottlenecks?

library(profvis)
profvis({
  x <- integer()
  for (i in 1:10000){
    x <- c(x, i)
  }
})

Code profiling

Code optimisation

Non-exhaustive list of ideas:

  • Vectorisation
  • Avoid copies
  • Find a faster existing function (e.g. that uses RCpp)
  • Do less - use a more specialised function

Caveats

  • Can make code harder to understand
  • Can increase maintenance burden
  • Avoid premature optimisation
  • Focus on biggest impact areas

How to start?

  • Review your development workflow
  • Document how to use your package efficiently
  • Profile your package code
  • Try one optimisation

Want to collaborate? Get in touch!

Resources

Image credits