Open Bug 810214 Opened 14 years ago Updated 1 year ago

Processing http://lib.tkk.fi/Dipl/2002/urn007413.pdf is slow, and its text layer is all messed up

Categories

(Firefox :: PDF Viewer, defect, P3)

x86
Linux
defect

Tracking

()

Performance Impact low

People

(Reporter: smaug, Unassigned)

References

Details

(Keywords: perf:responsiveness, Whiteboard: [pdfjs-performance])

Attachments

(1 file, 2 external files)

For some reason http://lib.tkk.fi/Dipl/2002/urn007413.pdf is slow. When scrolling it things are rendered incrementally, which is nice since it doesn't block UI, but slowly. If my profiling is right, most of the time is spent somewhere under CanvasRenderingContext2D. I wonder if pdf.js is using the canvas in most optimized way, or is there something to fix in canvas implementation. (This is on Linux, so cairo certainly shows up in the profiles too)
I have also seen this, it seems to be caused by Type 3 fonts, which are exceptionally slow to render in pdf.js. Other viewers do fine. Comparing output, in pdf.js each instance of a letter looks different, whereas in say Acrobat each looks the same. So maybe pdf.js is rendering each letter every time instead of caching the glyphs?
Priority: -- → P3
Whiteboard: [pdfjs-c-performance]
Bug 1054161 should help by speeding up the text layer. Actually... the text layer is all messed up for this document. There are plenty of text divs but they all contain junk, and the text isn't selectable or searchable for the most part.
Depends on: 1054161
Summary: Processing http://lib.tkk.fi/Dipl/2002/urn007413.pdf is slow → Processing http://lib.tkk.fi/Dipl/2002/urn007413.pdf is slow, and its text layer is all messed up

Works for me with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0

Mozregression shows that it got much better between 2013-06-10 and 2013-06-11. But still with the recent nightly the PDF is not that fast displayed as Acrobat does, but I suggest it's good enough.

Attached file urn007413.pdf —

It's still slow on Linux, maybe there something else we can do to improve it further.

Whiteboard: [pdfjs-c-performance] → [pdfjs-performance]
Performance Impact: --- → ?
Performance Impact: ? → P3

I don't see any performance issue on windows 11.
Can someone share a profile from linux ?

About the text layer which is "messed up": I think it's a way to avoid copy/paste.
From the document properties, it isn't possible to change, copy, ... the contents.
Very likely to avoid to get the text thanks to tools which bypass the permissions, the text has been obfuscated.

FWIW, the pdf works quite well for me these days, on linux at least.

Commit merged into master by GitHub Authored by Tim van der Meij (timvandermeij)
Depends on: 1768821

Better after https://github.com/mozilla/pdf.js/pull/14858, still slower than native readers.

:marco, could you share a nightly profile ?

It's still the issue with CanvasRenderingContext2D.save.

Severity: normal → S3
Depends on: 1957276
No longer depends on: 1957276
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: