Closed Bug 1883982 Opened 2 years ago Closed 2 years ago

High CPU usage on many websites after update due to "Layout: Style Computation"

Categories

(Core :: Layout, defect)

Firefox 123
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: maximumsomething, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

Sometimes a website will start using 100-200+% CPU. Unfortunately it is not consistent which website causes the issue; however more complicated sites seem to cause it more often (I've never seen it happen with a Wikipedia page). Frequently it occurs when switching back to a tab that was previously in the background. The most recent webpage I have reproduced this bug on is https://tex.stackexchange.com/questions/307795/how-to-create-nonbreaking-arbitrary-length-snakes-for-full-width-justification

Actual results:

The website will continue to use excessive CPU, even if the window is not in focus, until another tab is switched to. The CPU usage will continue if the problem tab is switched back to. The profile button in about:processes gives: https://share.firefox.dev/3wCJFu2, which seems to point to an issue with stylesheets.

Expected results:

Only a brief spike in CPU usage when switching to the tab.

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout
Product: Firefox → Core

Thanks, it seems like there's some script in the page or an extension is continuously changing a stylesheet every frame which causes us to recompute the style of the whole document...

I can't reproduce it off-hand in the URL from comment 0, and the profile there has no URLs, so followup questions:

  • Does this reproduce in safe mode, or with all extensions disabled?
  • Could you update a profile like the one you attached (with the "firefox" preset or so), but with URLs? If you can't share it publicly, could you send it to me via email?

Thank you.

Flags: needinfo?(maximumsomething)

[triaging as S3 given that we haven't yet been able to repro, and initial diagnosis points to pathological behavior on a page and/or extension per comment 2]

Reporter: see questions in comment 2 (if you haven't already replied directly) -- thanks!

Severity: -- → S3

Apologies, it looks like the problem was caused by the Dark Reader extension.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(maximumsomething)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: