mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.63k stars 10k forks source link

Stripes extremely slow to render #17959

Open muster-mark opened 7 months ago

muster-mark commented 7 months ago

I used puppeteer create a pdf from a page using css linear-gradient (I tried to use repeating-linear-gradient which would have been more natural, but ran into https://github.com/mozilla/pdf.js/issues/5046). I changed to use linear-gradient, letting the background itself repeat. The resulting pdf renders astonishingly slow in firefox - you can see it being rendered cell by cell. In chrome and acrobat it renders pretty much instantaneously.

slow_to_render.pdf

calixteman commented 7 months ago

What's your Firefox version ? Could make a profile in using the Firefox profiler ?

muster-mark commented 6 months ago

I am using Firefox 125. Here is a profile:

Firefox 2024-04-28 11.33 profile.json.gz

THausherr commented 6 months ago

it's rendered faster (not "cell by cell", more like "line by line") for me. FF 125.0.2 on Windows 10. But yes, chrome is faster.

muster-mark commented 6 months ago

it's rendered faster (not "cell by cell", more like "line by line") for me. FF 125.0.2 on Windows 10. But yes, chrome is faster.

Actually, does seem to be row by row for me too.