Open Bug 1677784 Opened 4 years ago Updated 2 years ago

PDF.js in Firefox slower than Chrome to load first page of large presentation

Categories

(Firefox :: PDF Viewer, defect)

Firefox 85
defect

Tracking

()

Performance Impact medium

People

(Reporter: jonas, Unassigned)

Details

(Whiteboard: [pdfjs-performance])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

Download this large PDF http://dev.pocoo.org/~mitsuhiko/droidcon-ndk.pdf

Go to https://mozilla.github.io/pdf.js/web/viewer.html

Open the PDF in PDF.js and wait for first page to be rendered

Actual results:

Took ~10s in FF nightly

Expected results:

Should take ~5s (Chrome benchmark)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → PDF Viewer
Whiteboard: [pdfjs-performance][pdfjs-triage-needed]
Whiteboard: [pdfjs-performance][pdfjs-triage-needed] → [pdfjs-performance]
Performance Impact: --- → ?
Performance Impact: ? → P2

There are few big images in this pdf, for example on the first page there is one where dimensions are 14516x6284.
I profiled the loading and we spend around 3.2s in the worker in buildPaintImageXObject and around 1s in the main thread in paintInlineImageXObject.
Now we've OffscreenCanvas available in the worker (see bug 1763330), hence we could probably improve the situation. But images are still bigs...

Severity: -- → S3
Status: UNCONFIRMED → NEW
Type: enhancement → defect
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.