Microsoft propose sustainability section in Edge DevTools
It’s a typhoon weekend here in Taiwan. Typhoon Hinnamnor is rolling up the east coast of the island, and there’s another system off the north-east coast as well. All that is to say, it’s going to be a wet old weekend. That should hopefully give me a chance to get around to a few side projects that have been unattended for a while.
We’ve been running with a web sustainability theme these past few weeks. In keeping with that, this week I’ll be looking at a new proposal from the Microsoft Edge DevTools team to introduce a “sustainability” tab into the Edge browser’s DevTools platform.
Getting accurate measurements of a website or app’s carbon impact can be extremely difficult. Ismael Velasco talks through the nuance of digital carbon calculations on his blog. Even if you just want to measure how much energy your site or app consumes, you’d probably need to get yourself a watt-meter, and work out a way to run your app in isolation.
The growing number of online website carbon calculators serve as a great entry point for those interested in figuring out their site’s environmental impact. However, they are far from perfect. There are assumptions made about visitors, caching, and even different research and energy intensity figures used in calculations. David Mytton gave a well explained take on this in a recent episode of the Green.io podcast.
That’s not to throw any shade on website carbon calculators. They are a fantastic starting point, enabling more people to get a first insight into the carbon impacts of their website. With that in mind though, getting more detailed data into the hands of developers could really help progress the push towards more accurate digital carbon calculations. It may also help unlock the door to making digital carbon part of the development and business conversation, much in the same way performance and accessibility are now.
Exposing more granular data
In Ismael’s article, he covers the complexity of calculating digital carbon emissions since no two devices or circumstances are the same. That’s one of the reasons why a general-purpose website/digital carbon calculator can only ever provide indicative results. But with these calculators, and the methodologies behind them, as a starting point we can start looking for better ways to get more accurate results.
Using more specific energy intensity figures
To calculate the carbon emissions of an app or website, you’ll need to figure out the energy used for each part of the process and then multiply that by the grid intensity (CO2 per kilowatt hour). What you’ll normally see is that most digital carbon calculations use a global average grid intensity figure when returning results. Again, this is a great start and is probably the right figure to be using for calculating emissions from network traffic.
However, for location specific segments like data centers or end user devices it should be possible to use grid intensity figures for the country or area in which those segments are located. That’s something we’ve got in the works for CO2.js, as we look to make use of open data from Ember and the UNFCCC.
There’s plenty of research around the energy consumption of data centers, networks, and devices. There’s an equal, if not greater, amount of conjecture around the accuracy and validity of some research findings and figures. We’re not going to get into that here.
Most cloud hosting providers aren’t publishing detailed energy consumption figures for their data centers. Industry secrets, competitive advantages, stuff like that I suppose. Some do have average grid intensity values published (see this example from Google), but we’re still going to be working with a few generalisations and assumptions when working out the emissions attributed to data centers.
Getting better energy usage data at the device level
For the longest time we’ve also had to work on assumptions when determining how much energy our apps and websites consume on a user’s device. Safari does have some energy usage information surfaced in its DevTools, but I’m not an Apple person so can’t speak to this with any authority. For the main, though, to get detailed energy consumption data you’d have to calculate it yourself which is no mean feat.
That’s why I’m pretty excited by this proposal from the Microsoft Edge DevTools team (we finally got to the topic of this post ey!). In it, they outline a new Sustainability tab in DevTools that would surface website sustainability issues, suggestions, and metrics. I’ve got my questions about the issues and suggestions. There are other comments on the feedback page questioning if publishing a CO2 figure would really be all that helpful.
What interests me the most about this proposal, however, is the possibility that detailed energy usage data could be available at the device level. The current proposal suggests an energy consumption “score”, but I’d really like to see the actual consumption figures also provided. Being able to get this data could:
- Enable developers to see the energy consumption of their apps/sites.
- Allow developers to assess the energy impacts of code changes, and block changes that increase energy usage.
- Pave the way for more detailed device level emissions estimates.
What might be
Those first two points have some tangible flow on effects as well. The less power an app or site is consuming, the less of a drain it will be on the battery of a mobile device or laptop. Energy consumption information can allow us to identify the sites or apps that might be draining our battery, and look for more effective alternatives. Once marketing teams grab a hold of this, we might even start to see energy consumption become part of an app’s messaging. Heck, Google and Apple might even put up “energy scores” as part of App Store listings.
The Edge team are at the start of what might be a long journey to get more sustainability data into DevTools. I’m sure that over time the data they can and plan to include will evolve with community feedback. You can read the full proposal on GitHub, and submit your own feedback in this issue.
With Edge now running on Chromium, I hope that the work the Microsoft team do here can also find its way into the DevTools of Chrome and other Chromium-based browsers. Because, while some data and assumptions about digital’s carbon impact may be imperfect, raising awareness of digital sustainability among more developers can help drive action for the better. Which is what our industry and our planet needs.
The next issue of Optimised will be in your inbox on September 16th The website has an archive of all previous emails. It's a good place to recap on anything we've covered, and also handy to share with friends or colleagues. As always if you've got any feedback or specific topics you want to be covered then just reply to this email.
Keep safe, stay well.