Improve how we compute the power consumption numbers from the Firefox Profiler output #2220
+52
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @soulgalore!
I was looking at some of the profiles and the powerConsumption metrics that's generated using the Firefox Profiler. And realized that there were some issues related to how we compute this number.
This feature was first implemented here (and this is the issue)
processes
field, so now we look at the profiles recursively and sum all the power consumption counters coming from all the processes.count
values. In some platforms the first value can either be different, and might mean other things, or it can be incorrect. We already have this logic in the profiler frontend to ignore the first value for all the counters, so we weren't hitting this issue before. But I encountered this issue while I was comparing the values from the profiler frontend vs the browsertime.I recommend looking at the PR commit-by-commit as the commit messages also provide some context.
To be able to test locally, you can follow the instructions here: sitespeedio/sitespeed.io#3944 (comment)