Open Bug 1838865 Opened 1 year ago Updated 4 months ago

Viewing large PDF causes persistent high CPU and makes Firefox UI unresponsive

Categories

(Core :: Graphics: WebRender, defect)

Firefox 115
defect

Tracking

()

REOPENED
Performance Impact medium

People

(Reporter: mirzmaster, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf:resource-use, reproducible)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

Load the PDF at https://www.mississauga.ca/wp-content/uploads/2023/05/Mississauga-Cycling-Map-2021-Web-version.pdf.

Actual results:

The PDF is slow to render (slower than Edge) but not too awful. But even once loaded it I see increased CPU utilization around 20-30% on my Ryzen 5 3600. The rest of the Firefox UI becomes very slow/unresponsive, e.g. hovering over another tab takes a few seconds for the hover effect to show. Switching tabs takes 10 seconds.

Once the PDF tab is in the background, CPU utilization drops after 5 seconds to about 7% and the browser becomes responsive again. Returning to the PDF makes Firefox slow again.

Expected results:

I expected Firefox to remain responsive to user input, like Edge.

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

Component: Untriaged → Performance
Product: Firefox → Core

Can confirm all of that.
Profile with the PDF loading and scrolling up and down couple of times: https://share.firefox.dev/3Cz0vtG

And a profile of just switching tabs or moving mouse over toolbar icons : https://share.firefox.dev/3NyQi6M

Status: UNCONFIRMED → NEW
Ever confirmed: true

based on the time spent in WR* threads, putting this in Core:Graphics: Webrender.

Component: Performance → Graphics: WebRender
Performance Impact: --- → ?
See Also: → 1813325

It looks like this may be causing a display list with a huge number of spatial nodes to be created.

Severity: -- → S3

Sounds like the same problem as bug 1813325 then.

One difference from #1813325 is that it isn't just the pdf UI that is unresponsive but Firefox UI more generally.

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: Windows
Impact on browser: Causes noticeable jank
[x] Affects animation smoothness
[x] Able to reproduce locally

Performance Impact: ? → medium

Firefox on Android never allows scrolling down or zooming in and out on these PDF files. It quickly becomes unresponsive

go to

https://monitoruloficial.ro/e-monitor/

select 30 april 2024
click any of 40X links

try to zoom in and/or scroll

the pdf opens flawless instantl in Adobe Reader Mobile once downloaded

Justin Link

Updated • 10 months ago
Performance Impact: ? → medium

no, performance impact should be highest possible, as whole browser becomes totally unresponsive and must force stop it

Flags: needinfo?(gwatson)

I'll leave it to Justin to check what the right performance rating is for this, note that it may depend on an estimate of how many users are affected compared to other high priority performance bugs.

Flags: needinfo?(gwatson) → needinfo?(jlink)

I've cleared the Performance Impact field so that this will go back for performance triage again.

The bug as originally reported was Windows only and, although I don't remember the details now, it seems that I was able to reproduce locally.

If it is impacting Android as well then that would likely bump up the calculated performance impact (along with there being multiple users impacted).

Performance Impact: medium → ?
Flags: needinfo?(jlink)
See Also: → 1890537

Bug 1890537 has a profile, not sure if the underlying problem is the same.

See Also: → 1898295

Using the STR in https://bugzilla.mozilla.org/show_bug.cgi?id=1838865#c8, I can reproduce this on Android but not on Linux but that seems like it may be another problem. Unfortunately the original problem from comment 0 is no longer accessible. I'm going to close this bug and open a new one for the issue in comment 8.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → INCOMPLETE

Denis, are you able to reproduce this on older versions of Firefox? I'm trying to figure out if this is the same as bug 1896513.

Flags: needinfo?(dpalmeiro)

The Android bugs are likely due to GPU accelerated canvas (see bug 1896513 comment 34 and bug 1890537 comment 17).

Flags: needinfo?(dpalmeiro)

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] Android
Websites affected: Rare
Resource impact: Severe
[x] Able to reproduce locally
[x] Bug affects multiple sites
[x] Multiple reporters

Performance Impact: ? → medium
You need to log in before you can comment on or make changes to this bug.