question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ideas for trimming the LHR

See original GitHub issue

The LHR is getting big, often 1MB or more. Some unnecessary things we could trim:

  • a11y per-node explanation are on every details item, often repeated verbatim on multiple nodes, and we don’t use them in the report
  • tap-targets includes all possible bad targets. We should limit the number.
  • full page screenshot could be recaptured with lower quality (or reduced height) https://github.com/GoogleChrome/lighthouse/pull/11689

Feel free to add to the list.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
paulirishcommented, Feb 7, 2019

Little hack for a sunburst viz of an LHR’s size…

  1. Go to https://vasturiano.github.io/sunburst-chart/example/large-data/
  2. Copy an LHR into your clipboard.
  3. lhr = <paste>
  4. run this in console or snippets:
isPlainObject = function (obj) {
	return Object.prototype.toString.call(obj) === '[object Object]';
};

function calcObjSize(obj) {
 // recurse if array or object.
 if (Array.isArray(obj) || isPlainObject(obj)) {
    return Object.entries(obj).map(([key, value]) => {
     const node = {name: key};
     const nodeValue = calcObjSize(value, {});
     node[typeof nodeValue === 'number' ? 'value' : 'children'] = nodeValue;
     return node;
   });
 } else {
   return JSON.stringify(obj, null, 2).length;
 }
}

data = {
  children: calcObjSize(lhr),
  name: 'lhr',
};


document.querySelector('#chart').innerHTML = '';

    Sunburst()
      .data(data)
      .color(d => color(d.name))
      .minSliceAngle(.4)
      .showLabels(false)
      .tooltipContent((d, node) => `Size: <i>${node.value}</i>`)
    (document.getElementById('chart'));

example:

image

1reaction
paulirishcommented, Feb 7, 2019

what’s so bad about big LHRs anyway?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shaving or trimming prior to LHR treatments is more effective ...
Answer: Q: Shaving or trimming prior to LHR treatments is more effective in the long term? It is a good idea to follow...
Read more >
310 trim ideas in 2022 - Pinterest
Dec 15, 2022 - Explore Sherry Black Attkisson's board "trim ideas", ... See more ideas about moldings and trim, home remodeling, diy home...
Read more >
Von Duprin 996L-RV-626-06-LHR R&v 06 Lever Trim Clutch
Classroom Function, key locks and unlocks lever. Trim is Field-Reversible. Breakaway trim design is especially effective in areas where vandalism to door ...
Read more >
Disk Ideas - MKM Pottery Tools
Using the MKM Decorating Disk. This tool is designed to simplify and speed up the process of doing symmetrical decoration on any form....
Read more >
Win Christmas with these festive AvGeek tree decorating ideas
According to Martha Stewart, there's no wrong way to trim a tree so why not have a little fun with it? Forget the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found