Closed Bug 2033282 Opened 2 months ago Closed 3 days ago

High CPU consumption on google search result expansion - WR sw_compositor recomposites the window due to invisible animation

Categories

(Core :: DOM: Animation, defect)

defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact medium
Webcompat Priority P3
Webcompat Score 1

People

(Reporter: bht237, Unassigned)

References

(Depends on 1 open bug)

Details

User Story

user-impact-score:0

Attachments

(2 obsolete files)

On Windows 10 with 16GBytes of memory, I browse:

Google search

This is a normal google search that has an AI overview at the top of the results.
When the search results are displayed, then CPU consumption is normal, in the range from 0.2% to roughly 1%. However, when I click on the "Show more" button, then the result expands and CPU consumption jumps to 40% to 60% and my computer fans start making noise.

Component: General → Site Reports
Product: Firefox → Web Compatibility
Priority: -- → P1
Summary: Hi CPU consumption on google search result expansion → High CPU consumption on google search result expansion

Can you get a profile of this behavior? (Https://profiler.firefox.com)
Thanks!

Flags: needinfo?(bht237)
Flags: needinfo?(bht237)
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: --- → 1

I fixed up your links for now, but FYI the way you need to do markup for a link is like this: [link description](https://example.com)

Hi!

It's hard to tell from the current profile what's going on.

Is there any chance you can take a profile using the 'graphics' preset? (You can select it from the popup menu that you can open with the profiler button)

Thanks!

Flags: needinfo?(bht237)

I believe the composites are triggered by the gradient animation around the "Dive deeper in AI Mode" button. However, this button is offscreen. So I think the Firefox bug here is that, with the WebRender sw_compositor, we end up compositing even if the changes only affect clipped-out tiles.

Component: Site Reports → Graphics: WebRender
Flags: needinfo?(bht237)
Product: Web Compatibility → Core
Summary: High CPU consumption on google search result expansion → High CPU consumption on google search result expansion - WR sw_compositor recomposites the window due to offscreen animation
Version: Firefox 140 → Trunk

It seems to me that if the CSS animation with the rotated rectangles doesn't terminate when the button is scrolled out of the view (the way it is in the user's profile).

It seems to me that if the CSS animation with the rotated rectangles doesn't terminate when the button is scrolled out of the view (the way it is in the user's profile).

The Performance Impact Calculator has determined this bug's performance impact to be medium. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.

Platforms: [x] Windows [x] macOS [x] Linux
Websites affected: Major
Resource impact: Some
[x] Able to reproduce locally

Performance Impact: --- → medium
Severity: -- → S3

Glenn, can you take a look?

Flags: needinfo?(mozilla)
Duplicate of this bug: 2032772

Bug 2032772 is very similar, other than that it notes even with HW accel there is in fact still very high CPU churn too, just which is magnified even further in SW.

(In reply to Lee Salzman [:lsalzman] from comment #11)

Bug 2032772 is very similar, other than that it notes even with HW accel there is in fact still very high CPU churn too, just which is magnified even further in SW.

Closing my earlier-reported Bug 2032772 was actually a correct move. Update as of 21 Apr 2026, before Firefox 149.0.2 was updated to 150.0.0:

Perhaps some microupdate occurred in the meantime because the CPU hogging by Firefoxes' GPU process stopped while part of Google's AI Search page was still seen in the background. I haven't made any changes to my Firefox Settings or Extensions.

Not an issue in v.150.0.0, either.

Assignee: nobody → mozilla
Status: NEW → ASSIGNED

This seems to fix the high CPU usage for this scenario on swgl. I have been unable to test on CI as try server is just returning 502/503 at the moment, so will run a more thorough test later.

Flags: needinfo?(mozilla)
See Also: → 2030924
Duplicate of this bug: 2030924
Attachment #9572718 - Attachment is obsolete: true

I have the same issue, the only way I found to avoid it was with a uBlock filter to stop google's animation from triggering via:
||www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png$image

It seems to stem from the SVG https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png

<mask>
<linearGradient>
<clipPath>
<filter>
<feGaussianBlur stdDeviation="15">
<use>
<image class="Wrq4d">

Over about 5 seconds, Firefox profiling recorded:

x596 MozAfterPaint events
x600 DisplayList / WebRender display list updates
x598 paints of https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png
CSS animation named rotate-glow-rects
Target element: image ... class='Wrq4d' with animation property: rotate & compositor: true

Hope it helps

Attachment #9573261 - Attachment is obsolete: true
Priority: P1 → --

I have the same issue with AI overview when expanding show more. Firefox main pid goes from ~%5 to 500% CPU thread usage while staying on the same tab.
I'm on firefox-150.0-1.fc44.x86_64, Mesa 26.0.3-4, amd-gpu-firmware-20260410-1.fc44.noarch

Can confirm this issue on 150.0.1 under Linux. It's pretty bad as, if you leave a tab with this active, it can quickly kill your battery life.

Also seeing this with 150.0.1 on Ubuntu 22.04.5. I have to be careful where I leave my open tabs, but at least I know what to look for now.

FF 150.0.2 is also affected. Blocking www.gstatic.com/searchbox-team/eclipse_wave_blurred seems to solve the issue for now.

Can confirm this issue on recent Firefox updates about a month ago on Ubuntu-based Linux too. The problem remains in the latest v150.0.3

Seeing the same thing on Fedora 44 Firefox version 150.0.3 (64-bit). Uses all available CPU.

Still the same on FF 151.0 on win11 64. Uses 50% cpu with the FF GPU process
Blocking www.gstatic.com/searchbox-team/eclipse_wave_blurred still works

I'm curious why so many of you are getting Software WebRender. Can you attach the contents of about:support?

(In reply to Jeff Muizelaar [:jrmuizel] from comment #26)

I'm curious why so many of you are getting Software WebRender.

I'm using hardware WebRender and have this issue.

Still the same in 151.1

This must be eating batteries in laptops!

I can reproduce this on Arch Linux / Hyprland / Wayland with Firefox 151.0.
https://share.firefox.dev/3RluP5K

System / graphics:

  • Firefox: 151.0, Arch Linux package
  • OS: Arch Linux, kernel 7.0.9-arch1-1
  • DE/compositor: Hyprland 0.55.2, Wayland
  • GPU: AMD Radeon 890M Graphics
  • Driver: Mesa/radeonsi 26.1.1
  • Compositing: WebRender
  • This is not Software WebRender.
  • Display: 2880x1800 @ 120 Hz, scale 2.0

Reproduction:

  1. Open Google Search in Firefox.
  2. Trigger AI Overview / click "Show more" or an AI Overview preview.
  3. CPU/GPU usage rises and remains high while the AI Overview animation is active.

Workaround / confirmation:
Running this in the page console immediately stops the issue:

document.querySelectorAll('.Wrq4d').forEach(el => {
  el.style.animation = 'none';
  el.style.transition = 'none';
});

For a persistent workaround, add this to [uBlock Origin -> My filters]:

www.google.com##.Wrq4d:style(animation: none !important; transition: none !important;)
www.google.pl##.Wrq4d:style(animation: none !important; transition: none !important;)

Profiler observations [by: codex 5.5]:

  • The captured process is an Isolated Web Content process for the Google Search tab.
  • GeckoMain is the only significantly busy thread in that content process.
  • The profile shows repeated refresh-driver/rendering work after expanding AI Overview:
    • RefreshDriverTick
    • ViewManagerFlush
    • Styles
    • DoFlushPendingNotifications
    • Image Paint
    • DisplayList
    • WrDisplayList / ForwardDPTransaction
  • Tick reason appears as:
    HasPendingRenderingSteps(Update animations and send events)
  • Markers point to a CSSAnimation targeting:
    image class="Wrq4d"
  • There are animationiteration events for that same element.
  • Disabling the animation on .Wrq4d stops the CPU/GPU load immediately.

Any chance of seeing an update to the Priority of this? I'd argue the Severity should be S2 based on the number of user's affected; this is amazingly frustrating and fits well in the Examples of S2 bugs at https://firefox-source-docs.mozilla.org/bug-mgmt/guides/severity.html.

Severity: S3 → S2

This is probably a silly question, but how do I reproduce this now? I'm not much of a google search user - but I don't seem to get any AI Overview now for any searches I tried? Has this been replaced by the AI Mode tab or is it still possible to repro this?

Hiro, Emilio, is this is an offscreen animation, is it feasible to detect and stop the animation occurring on the content process side? Is the content process meant to prevent offscreen animations from triggering composites, or does it rely on webrender's visibility culling to reduce the work and skip composites?

Flags: needinfo?(hikezoe.birchill)
Flags: needinfo?(emilio)

(In reply to Glenn Watson [:gw] from comment #32)

Hiro, Emilio, is this is an offscreen animation, is it feasible to detect and stop the animation occurring on the content process side? Is the content process meant to prevent offscreen animations from triggering composites, or does it rely on webrender's visibility culling to reduce the work and skip composites?

Basically it can. And indeed we have throttled offscreen animations. But given that the machinery doesn't work well on this specific case, there's something the machinery can't handle. Anyways, a reduced test case would tell us why it doesn't work.

Flags: needinfo?(hikezoe.birchill)

(In reply to Glenn Watson [:gw] from comment #31)

This is probably a silly question, but how do I reproduce this now? I'm not much of a google search user - but I don't seem to get any AI Overview now for any searches I tried? Has this been replaced by the AI Mode tab or is it still possible to repro this?

This happens to me too every so often. (I think it might be Google trying to offload/redistribute resources for AI usage?) Repeating the search in a private window usually gets AI mode to show up there.

(In reply to Glenn Watson [:gw] from comment #31)

This is probably a silly question, but how do I reproduce this now? I'm not much of a google search user - but I don't seem to get any AI Overview now for any searches I tried? Has this been replaced by the AI Mode tab or is it still possible to repro this?

  1. Created clean firefox profile (I'm using FF 140.11.0esr (64-bit))
  2. Opened url https://www.google.com/search?q=test+ai+search
  3. Clicked on "Show more..." button, CPU usage goes way up
  4. Opened Developer Tools, on inspector tab searched for 'blurred' (found one <image> element)
  5. When mouse hovers over this <image ...> in inspector, selection on page is being constantly and quickly updated, changing size and layout

(In reply to Glenn Watson [:gw] from comment #31)

This is probably a silly question, but how do I reproduce this now? I'm not much of a google search user - but I don't seem to get any AI Overview now for any searches I tried? Has this been replaced by the AI Mode tab or is it still possible to repro this?

It's still reproduce-able in the same way for me. I just ask 'what is beta testing' from the normal google search page (www.google.com), wait for the AI overview to appear at the top of the list of search results and click the show more button immediately below it.

FF 151.02
Win11 home 10.0.26200

Yeah, I can repro when logged in. The TLDR is that we have code to detect invisible animations and throttle them, but as Hiro noted is not working in this case.

I did some digging. The element is pretty on-screen tbh, and the only thing that hides the animation seems to be an opacity: 0 on the root <svg> element of that subtree.

However, that <svg> has:

animation: close-eclipse .3s cubic-bezier(0.2,0,0,1) forwards;

Where:

@keyframes close-eclipse {
  0% {
    display:block;
    opacity:1
  }
  99.99% {
    display:none;
    opacity:0
  }
  to {
    display:none;
    opacity:0
  }
}

We're detecting that the opacity: 0 subtree root animates opacity and failing to throttle here.

But also, display: none is supposed to apply and it'd stop this descendant animation too.

So there are two things that would fix this:

  • Bug 1834877, which would allow display: none in those keyframes to apply and stop rendering this <image>.
  • Bug 2043543, which would allow our opacity: 0 throttling to cover this case.
Depends on: 1834877
Flags: needinfo?(emilio)

(TLDR I don't think we should consider this a WebRender bug)

Nice find! So this is not offscreen animation case at all. This is just an animation fading out with fill:forwards.

Though Emilio mentioned this is not a WebRender bug, I wonder why WebRender takes so much CPU for invisible animation? That sounds odd.

Summary: High CPU consumption on google search result expansion - WR sw_compositor recomposites the window due to offscreen animation → High CPU consumption on google search result expansion - WR sw_compositor recomposites the window due to invisible animation

(In reply to Hiroyuki Ikezoe (:hiro) from comment #39)

Nice find! So this is not offscreen animation case at all. This is just an animation fading out with fill:forwards.

Though Emilio mentioned this is not a WebRender bug, I wonder why WebRender takes so much CPU for invisible animation? That sounds odd.

Confirming for 151.0.2 (aarch64) / MacOS Tahoe 26.5 (25F71), with Firefox h/w acceleration happily enabled.

The underlying scope appears much broader than the Google search AI context. IIRC, this issue has been around for quite some time, predating this bug report.

To Hiro's point: The fact that WebRender burns this much CPU on an invisible animation points to a broader issue in the compositor itself, rather than just a DOM throttling failure. Testing shows that adding a single, simple CSS animation to just one DOM element on an otherwise dead-static page causes a CPU spike in the Firefox GPU helper process, for as long as the animation runs and the tab remains active โ€” even if the browser window is in the background, thus making this a case for offscreen animation.

Exhibit A, and this may qualify as reduced test case: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Animations

Not saying CPU utilization shouldn't spike at all โ€” it's a matter of proportion. Elevated CPU load is totally fine for running something like QuakeJS, but rendering decorative animations shouldn't significantly ramp up CPU temperatures. I hope this can be fixed.

Here is an additional profile if needed: https://share.firefox.dev/4dHFDUt
Total CPU goes above 95% and the machine's fan is on constantly when the Google page is in the current tab.

Assignee: mozilla → nobody
Status: ASSIGNED → NEW
Component: Graphics: WebRender → DOM: Animation

Has someone tried a recent nightly? I am hoping this bug has been fixed by bug 2043543.

Still the same for me with FF 151.0.4 Win11 home 10.0.26200

(In reply to Hiroyuki Ikezoe (:hiro) from comment #42)

Has someone tried a recent nightly? I am hoping this bug has been fixed by bug 2043543.

It looks somewhat better, but not fully:

  1. Got latest Nightly for linux x86_64 153.0a1 (2026-06-10) (64-bit)
  2. Created new profile
  3. Opened https://www.google.com/search?q=google+ai+search in one tab and about:processes in other
  4. Pressed "Show more" button on google page
  5. On about:processes multiple WRWorkerLP#n threads each consume ~ 3% cpu (before "Show more" button they all were idle)
  6. Generally, before "show more" button, total cpu in about:processes was about 5-10%, after -- 40-50%
  7. Opened Developer Tools->Inspector, found svg containg https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png image
  8. When mouse hovers over this <image ...> in inspector, selection on page is being constantly and quickly updated, changing size and layout
  9. right click on svg -> context menu->delete node
  10. After that WRWorkerLP#n threads became idle again and cpu usage dropped back to 5-10%

(In reply to egor.duda from comment #44)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #42)

  1. Created new profile
  2. Opened https://www.google.com/search?q=google+ai+search in one tab and about:processes in other
  3. Pressed "Show more" button on google page
  4. On about:processes multiple WRWorkerLP#n threads each consume ~ 3% cpu (before "Show more" button they all were idle)
  5. Generally, before "show more" button, total cpu in about:processes was about 5-10%, after -- 40-50%
  6. Opened Developer Tools->Inspector, found svg containg https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png image
  7. When mouse hovers over this <image ...> in inspector, selection on page is being constantly and quickly updated, changing size and layout
  8. right click on svg -> context menu->delete node
  9. After that WRWorkerLP#n threads became idle again and cpu usage dropped back to 5-10%

Exactly the same to the letter under FF 151.0.4 on Win11 home 10.0.26200

Same problem with all 4 cores spinning at 100% on Fedora 44 with Firefox 151.0.1. I'm curios, how is it that a single animation can use 100% of 4 cores?

(In reply to Jamie from comment #17)

I have the same issue, the only way I found to avoid it was with a uBlock filter to stop google's animation from triggering via:
||www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png$image

It seems to stem from the SVG https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png

<mask>
<linearGradient>
<clipPath>
<filter>
<feGaussianBlur stdDeviation="15">
<use>
<image class="Wrq4d">

Over about 5 seconds, Firefox profiling recorded:

x596 MozAfterPaint events
x600 DisplayList / WebRender display list updates
x598 paints of https://www.gstatic.com/searchbox-team/eclipse_wave_blurred_rects_f2dcf436ae9c2b05017fd88933a1b6ad.png
CSS animation named rotate-glow-rects
Target element: image ... class='Wrq4d' with animation property: rotate & compositor: true

Hope it helps

It looks like this worked for me (Firefox 151.0.4 Linux). So far, so good at least.

For what it's worth, I no longer experience the issues with 152 under Linux.

Seems fixed for me as of 152.01 with win11

(In reply to GJR from comment #43)

Still the same for me with FF 151.0.4 Win11 home 10.0.26200
(In reply to GJR from comment #49)
Seems fixed for me as of 152.01 with win11

Given this (and comment 47 - comment 48), let's call this WORKSFORME.

(Note, the bugfix that hiro referenced in comment 42 actually landed in 153 and hasn't made it to release yet, so if anyone does happen to still be hitting this, please try in beta153 and see if you hit it there as well. We can reopen if folks are still hitting it in 153 or newer. Thanks!)

Status: NEW → RESOLVED
Closed: 3 days ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: