Chapter 6. Measuring and Reducing Your Code’s Carbon Footprint
A wise person at Google once told me, “The internet is a building.” It requires electricity, water, and other familiar resources to run and cool the massive data centers that make up the internet and store its zettabytes of data.1 These resources come at a cost to our planet. Anything you do online—texting a friend, searching the web, streaming your favorite music, watching a YouTube video, or just leaving your browser open overnight—ultimately translates to emissions of greenhouse gases such as carbon dioxide that alter the Earth’s climate. It’s easy to forget this when you’re busy blasting space aliens or shopping online for bunny slippers.
Likewise, if you’re a software engineer, every piece of code you write has an associated impact on carbon emissions, which is called its carbon footprint. If your code is a small script that runs on one desktop computer, then its carbon footprint may be tiny. If your code runs on millions of CPUs in a data center that gets its electricity from burning coal, then its carbon footprint may be more significant. If your code is a smartphone app, then its carbon footprint encompasses the electricity to charge the phones that run the app each day. Your decisions about software design, in other words, are also decisions about carbon dioxide in our warming world. This chapter will help you understand the energy use and carbon footprint of your code and reduce them. If you enjoy tweaking ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access