Open Bug 1686240 Opened 4 years ago Updated 3 years ago

Inspector is slow when selecting a new node on youtube

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

Details

Youtube is known to have many styles. This was already significantly improved by Bug 1623988. Believe it or not, it was ~5 times slower before FF78. The next steps here were to try virtual/lazy viewports for the Rules view if I remember correctly.

There is also already a DAMP test for this: https://treeherder.mozilla.org/perfherder/graphs?highlightAlerts=1&highlightChangelogData=1&series=mozilla-central,2408425,1,12&timerange=7776000

YouTube has many, many CSS custom properties defined on :root which end up being inherited by all nodes.

This puts pressure both on the server which serializes them all and on the client which renders them all. Google Chrome throttles rendering of many CSS declarations with "show more" links.

The performance hit is exacerbated by processing done on the client side, like marking overwritten declarations, decorating them with color swatches, etc.

Here's similar performance issue from Salesforce web development:
https://share.firefox.dev/3yB4IJC
https://share.firefox.dev/3fSZ3r1

Salesforce also uses CSS custom properties and many of them - the element I was inspecting have 3661 properties.
I think it's a safe bet that noone will need to see all of them for every element :) I'd suggest 2 improvements here:

  1. Show only limited number of properties right away and the rest after clicking Expand button (honestly speaking, I never had to lookup properties, personally it would be sufficient for me if I could navigate to propty from the class/style that used it, but that's just me)
  2. Move that property loading logic to background job, so it doesn't freeze entire browser - the pane would show spinner until props are loaded

Kind Regards

You need to log in before you can comment on or make changes to this bug.