cnumr / ecoindex_cli

This tool provides an easy way to analyze websites with Ecoindex from your local computer. You have the ability to make the analysis on multiple pages with multiple screen resolution. You can also make a recursive analysis from a given website.
Other
47 stars 2 forks source link

[Feature]: Get greenhouse gas estimation corresponding to each measure (i.e. get partial results) #208

Closed benel closed 1 year ago

benel commented 1 year ago

While the comparison to median values for each mesure (number of requests, page size, number of DOM elements) is very valuable, knowing the estimated greenhouse gas emissions for each one would help prioritizing refactoring.

vvatelot commented 1 year ago

I am not sure to understand what you mean... :thinking: What do you mean by "for each one" ?

benel commented 1 year ago

I am not sure to understand what you mean... 🤔 What do you mean by "for each one" ?

Let's take a real example. https://cv.hal.science/aurelien-benel has a score of E with 2.34 gCO2e. Compared with mean values, the problems seem to come from the number of requests and of DOM elements. But which one should be refactored in priority by the CCSD? Maybe, one has only an impact of 0.5 g and the other has an impact of 1.8 g. What would be necessary for such a priorization would be the partial results that lead to 2.34.

tbroyer commented 1 year ago

If you only focus on the EcoIndex, then from the formula (https://www.ecoindex.fr/comment-ca-marche/#le-calcul-de-lecoindex) the size of the DOM has a bigger impact than the number of HTTP requests. That, however, is optimizing for the EcoIndex, not necessarily improving your actual environmental impact. For instance, does this page really need to display all 17+67+15+2=101 publication references at a time? (given how they're presented, maybe not; but maybe there's a good reason to do just that) Could it be split into more "focused" pages? Either not showing any reference by default or only the N most recent ones? Also, use Lighthouse or other similar tool to help optimize the frontend code (Lighthouse also says the server takes too much time to respond). Most of the 62 publication thumbnails aren't initially visible, so maybe first put loading=lazy on the ones most likely to be hidden (under the fold) by default (this won't necessarily change the EcoIndex as it scrolls down the page anyway), make the layout more "stable" by explicitly sizing the images to avoid reflows (again, won't change the EcoIndex, but has a real impact; the "nouvelle interface" does this right afaict, except it displays the thumbnails at a different size and even aspect ratio than their intrinsic size), etc. TL;DR: make it fast so users on slow hardware aren't incentivized to buy faster devices (given that the biggest impact is at manufacturing and disposal of user devices), and actually much more importantly: do/show only what users expect, and leave other features/data to other pages (that should remove both DOM nodes and HTTP requests). For instance, are those thumbnails really useful? they almost all look the same.

All that those finer-grained metrics would do is derail you from actually understanding (design) and measuring (optimize) what you're doing.

benel commented 1 year ago

Thank you for your advices @tbroyer... Just to be sure to be understood, I have no relation with the developers of HAL. This was just an example of a Web application with a positive social impact but a lot of unneeded negative ecological impacts.

I already know most of the good practices you mention. What I think is very interesting in CNUMR tools is the possibility to measure and hence to set the priority on what has the most impact.

I would have thought that having the detail of all three kind of impacts, would provide a way to focus on what has the most impact.

My current idea is to help a class of students, for a full semester (15 weeks), reducing the negative impact of a Web application. To do that, we will have to set priorities, do the first optimization, measure deltas, and move to the next priority (and so on).

benel commented 1 year ago

I had a look at the greenhouse emission formula. If I understand correctly, the total greenhouse emission is computed from the ecoindex, which itself aggregates the three quantiles, based on each measure. Hence, the partial results I hoped to see displayed in the tools do not exist as such. Hence the feature is far more complex to implement that I thought: it would require to design 3 completely new formula, right ?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.