thegreenwebfoundation / co2.js

An npm module for accessing the green web API, and estimating the carbon emissions from using digital services
https://developers.thegreenwebfoundation.org/
Other
417 stars 54 forks source link

Review 1byte model and update implementation. #68

Open mrchrisadams opened 2 years ago

mrchrisadams commented 2 years ago

The original version implemented based on the 1byte model deliberately left out bits that you wouldn't typically have access to when making calculations, because they were time based, like the duration of transfer used on a device.

This was originally derived by looking at the hourly consumption of a device, then dividing that number by the fraction of time a transfer took.

This issue here on the carbonalyser repo helps shed some light - specifically this quote:

The contribution of the terminal is calculated for two cases:the performance of an action on a smartphone and an action on a laptop computer. The consumption due to using the terminal is calculated on the basis of the hourly consumption of the terminal and the duration of use associated with the action

The full numbers are listed here too https://theshiftproject.org/en/carbonalyser-browser-extension/

It also didn't allow setting of carbon intensity, but defaulted to a high global average provided in the original methodology notes listed above.

Updating this

A properly updated model, assuming it's still worth doing given the changes since 2019 would likely to the following:

This issue is here for folks who are not happy with the 1byte model as implemented, and would like to see a more accurate / precise version in use. The Carbonlyser github repo has some helpful sample code to start.