GoogleChrome / lighthouse

Automated auditing, performance metrics, and best practices for the web.
https://developer.chrome.com/docs/lighthouse/overview/
Apache License 2.0
28.33k stars 9.36k forks source link

Add a memory/size audit #5057

Open natorion opened 6 years ago

natorion commented 6 years ago

Summary

We should provide a way in Lighthouse to audit memory/size of a web page.

Questions answered

Description of audit and audit category (please include pass/fail states, and how it might be measured)

We should provide a new audit category aimed at "Memory" (or "Size", which might fit even better) e.g. see the mock below image

In the first stage we should aim to highlight the full memory consumption. Currently Chrome's main memory tooling only surfaces around 50 % of the actual memory consumed. We have the total memory consumption of all chrome components in the mem-infra trace though.

Stage 1

What number do we want to surface:

Live full peak memory consumption:

Stage 2

What number do we want to surface:

Impact of cross origin iframes

Hacked-together mock:

image

Explanation of how it’s different from other audits

Memory/Size is currently not handled in Lighthouse.

What % of developers/pages will this impact (estimates OK, data points preferred)

When Lifecycle API or similar mechanisms are shipped, all of them.

How is the new audit making a better web for end users? (data points preferred)

Less consumption of precious system resources (RAM). Less trashing and emergency GCs.

What is the resourcing situation (who will create the audits, maintain the audits, and write/maintain the documentation)

Let's talk :-).

Do you envision this audit in the Lighthouse report or the full config in the CLI? If in the report, which section?

This should be in the default Lighthouse report.

How much support is needed from the Lighthouse team?

Let's talk :-).

Any other links or documentation that we should check out?

https://docs.google.com/presentation/d/14uV5jrJ0aPs0Hd0Ehu3JPV8IBGc3U8gU6daLAqj6NrM/edit#slide=id.p and other relevant, Google-internal docs.

vinamratasingal-zz commented 6 years ago

Hey Michael- thanks for submitting this. We're heads down on I/O, let's chat after about this proposal.

vinamratasingal-zz commented 6 years ago

Hey Michael- thanks for putting together this detailed proposal and for your patience! The team and I had a chance to sync up and we have a couple pieces of feedback:

natorion commented 6 years ago

There is indeed a case study in the works. We cannot make the numbers of the currently running study public though.

Regarding the technical questions, what specific concerns do you have?

I guess the audits can also live in DevTools. My impression was that audits should go to LH though? My impression is that if I open DevTools I already know that there is a problem I want to investigate and LH is a handling the step before that: Highlighting that there is something to fix. I also heard from web developers that they use LH in their CI to test for 'compliance', something that will not automatically work with DevTools.

natorion commented 6 years ago

Friendly ping on this.

natorion commented 6 years ago

@paulirish

doteric commented 1 year ago

Sounds like a great idea, by any chance is there any plan to bring this back up? Memory leaks seem to be more often the case these days on complex apps for some reason...
Preferably it would be nice if this was available in user flows as memory is often the problem after a certain amount of user interactions rather than on page load.

CC @adamraine

adamraine commented 1 year ago

We definitely could offer some memory statistics and heap snapshots, but with the way Lighthouse has evolved I don't think a timeline view of memory makes sense anymore.

doteric commented 1 year ago

Thanks @adamraine for the quick feedback, Could you please elaborate on the "I don't think a timeline view of memory makes sense anymore" part please? Not sure what you mean by that exactly? Would appreciate it

adamraine commented 1 year ago

I was referring to some sort of graph that shows the memory usage over time. This would be hard to visualize due to how Lighthouse throttles the page by default.

doteric commented 1 year ago

Ah alright, totally a graph would not be needed but data points of memory being used on certain stages would be nice. It would be useful on userflows especially to see the amount of memory between certain actions 😃
Thanks for the replies Adam btw 💪