Skip to content

very slow rendering for some pages in PDF #5248

@GerHobbelt

Description

@GerHobbelt

SumatraPDF version

  • 3.5.2

Describe the bug / To Reproduce

open PDF, view pages as usual. Go to page 110 and observe Sumatra freezing while displaying the text "please wait - rendering..." for about 28 seconds on a fast, fully stocked and otherwise very lightly loaded AMD Ryzen / Win10 box.

The page, finally, shows up without obvious faults.

Hit PgDn key to jump to the next few pages, some of which will also exhibit this same 'extremely slow' behaviour.

Expected behavior

Well... 😉

File that reproduces the problem

PDF has been attached. (See further notes below.)

Screenshots
N.A.

Additional context

I know the engine (mupdf) had some 'takes a heck of a lot of time' issues with some sea geo-charts, which were PDF pages loaded with a humongous number of tiny vector drawing instructions. (Might that one be #3841 / #3842 in your issue lists, perhaps?)
I don't recall Artifex "fixing" that one down to sub-second render times (if that's possible at all, though I do recall Acrobat having no issue showing those charts quite swiftly), though at some point (IIRC, fingers crossed) there were mupdf commits that reduced the problem by a large margin (IIRC something about render stack push/pop instructions being optimized out for certain PDF layer start/end instructions).

Anyway, that was then (2023-ish), this is a new one.

Now this new PDF doesn't have anything looking like "lots and lots of vectors" in the offending pages, so it's probably only sideways related, hence new issue.

Apologies for not having run this through my own mupdf variant (dev focus is currently elsewhere, for me, sorry!), so I don't know what's going on exactly with this new 2026 PDF example.

Another thing I noted for this one: I tried to (quickly) produce a Minimal Sample PDF by deleting the first 100+ pages using NAPS2 and the resulting PDF was a horribly large 340 MByte, while this one is 'only' 37MB, so there's probably more going on in there...

Anyway, AFAICT, only 2-3 pages of the PDF exhibit this "veeeeery slow page render" behaviour, which also freezes the SumatraPDF UI.
I know you're using mupdf under the hood (👍) and IIRC the original Artifex codebase (my own mupdf is 'vendored' by various patches, so I'm not certain it was in the original as well) had a way to abort page rendering -- IIRC it could be accomplished via hooking the progress monitor and toggling a flag, but that's my shoddy brain and away from the dev box, so YMMV.
Anyhow, MAYBE you can find a way to abort page renders like these when users hit PgUp/PgDn keys to jump away? (That would mean rendering in a separate thread so I bet that's a non-trivial code change. Still, it would be nice to have. My own mupdf copy uses another approach, which is to become a very rough and shoddy renderer, ignoring/skipping many PDF render instructions (layer stacking, transparencies) once the time-to-render-this-page surpasses configured maximum duration thresholds: this approach works for me but required patching the mupdf engine in a couple of places and may not be acceptable for others as you'll end up with 'garbled' page images that way, naturally.) I have not checked this new PDF with my own engine yet, so I don't know if this one triggers something entirely different...

Thank you for maintaining a very useful and appreciated PDF reader -- I've ditched Acrobat and a few others as Sumatra also handles my ebooks (entertainment) quite well, so it's my one-stop-shop for document reading these days! ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions