> Markdown version of [/videos/786-11-tips-for-greener-code](https://www.wearedevelopers.com/videos/786-11-tips-for-greener-code). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # 11 Tips for Greener Code A single petabyte of dormant data consumes 19 megawatt-hours annually. Discover eleven tactical programming decisions to drastically reduce your cloud spend and carbon footprint. - **Speakers:** Kent Simonsen - **Event:** World Congress 2023 - **Published:** October 23, 2023 - **Duration:** 9:23 - **URL:** https://www.wearedevelopers.com/videos/786-11-tips-for-greener-code ## Summary Software engineering generates significant CO2 emissions, increasingly requiring developers to treat sustainability as a core, measurable non-functional requirement alongside security and performance. Treating green code as a primary objective means utilizing open-source and vendor-specific tools to measure carbon footprints accurately, as energy improvement requires baseline metrics. Waste reduction across operations and infrastructure offers immediate environmental and financial benefits. Because cloud spending correlates closely with energy consumption, eliminating unused data and abandoned code can reclaim the estimated 30% of cloud utilization waste. Teams can optimize operations by setting timeouts in unit testing, adopting serverless architectures to scale idle processes down to zero, and auditing CI/CD pipelines to prevent redundant tasks like repeated package installations. Even dormant data storage carries a heavy toll, with a single petabyte consuming roughly 19 megawatt-hours annually. At the tactical level, subtle programming decisions drastically alter energy consumption. Micro-benchmarking experiments reveal that optimizing loops via memoization, minimizing data payloads by preferring formats like protobuf over XML, and replacing expensive reflection-based operations with custom code-generated deserializers dramatically reduce processing overhead. Language selection also dictates energy use, though developers must test implementations against specific use cases rather than relying solely on generalized language energy rankings. **Keywords:** green software engineering, carbon footprint measurement, non-functional requirements, cloud resource waste, code micro-benchmarking, unit testing timeouts, CI/CD pipeline efficiency, serverless architecture adoption, data storage energy costs, hardware lifecycle management, loop memoization, network payload optimization, protobuf serialization, reflection-based deserialization, programming language energy efficiency ## Chapters 1. **The environmental impact of software engineering** (00:03) — Software engineering and cloud infrastructure contribute significantly to global carbon emissions. 1. **Setting goals and measuring carbon emissions in software** (00:43) — Making green code a non-functional requirement relies heavily on specific measurement tools and micro-benchmarking experiments. 1. **Eliminating unused data and reducing cloud resource waste** (02:45) — Removing inactive code and unused data directly cuts energy consumption and overall cloud computing footprints. 1. **Optimizing testing tools and continuous integration pipelines** (03:28) — Adding test timeouts and avoiding unnecessary parallel builds reduces processing time and excessive energy use. 1. **Adopting serverless architectures and deleting idle storage data** (04:59) — Scaling down idle processes with serverless paradigms and deleting unused data storage prevents massive electricity waste. 1. **Balancing hardware efficiency with manufacturing carbon footprints** (06:04) — Understanding the carbon costs embedded in manufacturing dictates when to replace servers versus personal devices. 1. **Minimizing loop operations and reducing network data transfer** (06:43) — Moving variable initializations outside loops and switching from verbose data structures to strict formats drastically curbs resource usage. 1. **Implementing efficient deserialization code and programming algorithms** (07:45) — Replacing reflection-based parsing with custom deserializers and selecting energy-efficient programming languages lowers core system overhead. ## Related Moments - [Coding for environmental sustainability in software engineering](https://www.wearedevelopers.com/videos/602-unlocking-the-potential-of-digital-it-at-vodafone) (from "Unlocking the potential of Digital & IT at Vodafone") - [Implementing architectural best practices for sustainable software systems](https://www.wearedevelopers.com/videos/1414-a-hitchhiker-s-guide-to-resource-efficient-software) (from "A Hitchhiker's Guide to Resource Efficient Software") - [Connecting web performance optimization to ecological sustainability](https://www.wearedevelopers.com/videos/937-sleek-swift-and-sustainable-optimizations-every-web-developer-should-consider) (from "Sleek, Swift, and Sustainable: Optimizations every web developer should consider") - [Defining green cloud computing and software principles](https://www.wearedevelopers.com/videos/592-green-cloud-computing) (from "Green Cloud Computing") - [Building an implementation strategy for green software](https://www.wearedevelopers.com/videos/100251-one-year-of-the-co2-challenge-insights-and-lessons-learned) (from "One year of the CO2-challenge – insights and lessons learned") - [Universal strategies for greener product development cycles](https://www.wearedevelopers.com/videos/592-green-cloud-computing) (from "Green Cloud Computing") ## Related Articles - [Is Software Development Making the Climate Crisis Worse?](https://www.wearedevelopers.com/magazine/551-is-software-development-making-the-climate-crisis-worse) - [Dev Digest 120 - Apple and peers](https://www.wearedevelopers.com/magazine/455-dev-digest-120-apple-and-peers) - [How to Avoid Over-Engineering](https://www.wearedevelopers.com/magazine/546-how-to-avoid-over-engineering) - [Dev Digest 127 - putting 5 rings on it](https://www.wearedevelopers.com/magazine/464-dev-digest-127-putting-5-rings-on-it) ## Related Jobs - [Senior Software Engineer, Enterprise Products](https://www.wearedevelopers.com/jobs/ext/1841248-senior-software-engineer-enterprise-products) at **GitHub** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/159190-senior-software-engineer) at **GitHub** - [Tribe Lead - ( Software) Engineering Centre of Excllence](https://www.wearedevelopers.com/jobs/ext/1475530-tribe-lead-software-engineering-centre-of-excllence) at **SD Worx** - [Senior Software Engineer,Billing](https://www.wearedevelopers.com/jobs/ext/1991843-senior-software-engineer-billing) at **GitHub** - [Principal Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1465908-principal-software-engineer-database-infrastructure) at **GitHub**