Open Bug 1508765 Opened 6 years ago Updated 9 months ago

Firefox is very slow to render poster PDF

Categories

(Firefox :: PDF Viewer, defect, P3)

65 Branch
defect

Tracking

()

Performance Impact medium
Tracking Status
firefox-esr102 --- wontfix
firefox113 --- wontfix
firefox114 --- wontfix
firefox115 --- wontfix
firefox116 --- wontfix

People

(Reporter: linuxhippy, Unassigned)

References

Details

(7 keywords, Whiteboard: [pdfjs-performance])

Attachments

(1 file)

3.90 MB, application/x-7z-compressed
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

1. opened PDF  located at: https://wiki.eclipse.org/images/0/07/CDO-Poster.pdf


Actual results:

Firefox / PDF.js takes 5minutes on rather modern hardware (I5-6300U / Windows-7) to render the PDF


Expected results:

Firefox should be at least as fast as evince (15s) loading this file.

Google Chrome loads the PDF in 2-3s.
Component: Untriaged → PDF Viewer
Attached file CDO-Poster.7z
uploading the gecko profile failed multiple times (XHR onerror was called), please find the gecko profiler data at: https://drive.google.com/open?id=1AmP5_Qh8vXEcbuBrcvzqDWvHzHg9dTlr

it seems a lot of time is spent inside canvas functions.
Keywords: parity-chrome, perf
Priority: -- → P3
Whiteboard: [pdfjs-c-performance]

Around 20s for me in nightly 85 on Linux.
:Clemens, is it still an issue for you ?

Flags: needinfo?(linuxhippy)

I guess the question is not so much whether this specific case is an issue for me, but rather why Firefox's integrated PDF viewer is about 10x slower than its direct competitor Google Chrome.

Flags: needinfo?(linuxhippy)
Whiteboard: [pdfjs-c-performance] → [pdfjs-performance]
Severity: normal → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Firefox takes 5min to render poster PDF → Firefox is very slow to render poster PDF

Here's a profile from nightly on Windows 11:
https://share.firefox.dev/3OKBJy7

We spend a lot of time in removing an Observer:
https://searchfox.org/mozilla-central/rev/f4d3fe187cf7dffa4c13b354bbde9bc47b5ccd3f/dom/canvas/ImageBitmap.cpp#86

:tnikkel, could you have a look please ?

Performance Impact: --- → ?
Flags: needinfo?(tnikkel)

It looks like this observer was added in bug 1414825.

Blocks: 1414825

It looks like nsContentUtils::RegisterShutdownObserver, and in general things that add an observer to the observer service, just store the observer in a regular array, so removing an observer is O(n) in number of observers. That is not suitable to use for objects like ImageBitmap where we might create a lot of them.

No longer blocks: 1414825
Keywords: regression
Regressed by: 1414825

Set release status flags based on info from the regressing bug 1414825

Set release status flags based on info from the regressing bug 1414825

Depends on: 1839286

I'm gonna move that part of this that is a regression from bug 1414825 to bug 1839286, because after fixing that this testcase is still pretty slow, so there is mor going on here than just that.

Flags: needinfo?(tnikkel)
No longer regressed by: 1414825

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
Impact on site: Causes noticeable jank
Page load impact: Severe
Websites affected: Rare
[x] Affects animation smoothness
[x] Able to reproduce locally

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

Attachment

General

Created:
Updated:
Size: