Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

de-dupe screenshot urls in LHR #14689

Closed
connorjclark opened this issue Jan 18, 2023 · 1 comment
Closed

de-dupe screenshot urls in LHR #14689

connorjclark opened this issue Jan 18, 2023 · 1 comment
Assignees
Labels
11.0 cranked up to eleven breaking P2

Comments

@connorjclark
Copy link
Collaborator

connorjclark commented Jan 18, 2023

As suggested in #14679 by @benschwarz – we could save the raw size of the LHR ~100+ KB if we de-duped data url screenshots.

Not just for screenshot-thumbnails, but also final-screenshot (which after #14679 would be equivalent to the last screenshot thumbnail). If we went that route, we'd want to add a top-level screenshots or dataUrls, etc.

We could go further and drop screenshot-thumbnails and final-screenshot as audits, and just have a top-level item like:

screenshots: {
  dataUrls: string[];
  frames: Array<{index: number, timing: number, timestamp: number}>
};

(many other ways to slice this)

and the report renderer would just grab from that to do its thing

@paulirish
Copy link
Member

paulirish commented Jul 17, 2023

We have other cases where deduping would be advantageous to JSON size.. like all the URLs... The solution is similar.. Having some big urls array and then everything references a urlIndex.. More or less.

Going in this direction...

  • we could apply these changes and then formalize the LH.ReportResult which is.. like the usable version of the LHR. And it'd undo these space saving changes.
  • we could instead maintain a lil side library (a la median/representative runs) to change the LHR into a SlimLHR which.. isn't officially supported but ... we could kinda maintain some optimizations as a community.

however.. right now we're thinking it may be premature to go this route..

in some experiments we've found that compression does a pretty great job on LHRs so.. leaving them brotli'd or zstd'd at rest might be the most cost-effective solution:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.0 cranked up to eleven breaking P2
Projects
None yet
Development

No branches or pull requests

4 participants