Miniature thumbnails in the sidebar render before the page contents canvas, and do not reuse the page's render, doubling render times
This is the follow-up to #98 (comment 2084371)
Essentially, with this sample file (from Poppler issue 1456) or this big sample, on the latest main
/ nightly version of Papers that reverted the imperfect multithreading approach (through !147 (merged)), you can notice that Papers:
- Still renders the sidebar thumbnails before the page contents;
- Still takes 2x the time it should take, because it renders every page twice (due to the sidebar thumbnails) instead of reusing/sharing rendered outputs/textures. Evince is affected in the same way here.
We will need to also ensure that no thumbnails rendering processing is happening at all when the sidebar is hidden (especially as part of #118 (closed)), for various reasons (including saving CPU cycles, reducing power consumption, etc.). Evince did that already (see below).
My second sample linked above is more useful for testing than the sample from Poppler isuse 1458, because it my sample makes the effects much more obvious (it takes a total of 24 seconds to render in Papers: 12 seconds for the sidebar thumbnail, then 12 seconds for the main page contents view), even though the backend performance problems (in LCMS) are the same according to my profiling.
Comparative benchmark results (with the 2nd sample)
-
Papers
main
renders the document's sidebar thumbnail first, in 12 seconds.
Then it renders the document's page in 12 additional seconds,
totalling 24+ seconds until you can see the full-size page contents. -
Evince 45 renders the document's page content first, in 12 seconds.
Then, if the sidebar was shown on startup, Evince renders the sidebar's thumbnail 12 seconds later.
If the sidebar was disabled on startup, Evince does not try to render a sidebar thumbnail, it stops using CPU at the first 12 seconds mark, it does not burn the CPU up to 24 seconds.
For the record, no-sidebar-Okular renders the same document in 4 seconds instead of 12-24 seconds, but it is an unfair comparison at this time because of Poppler issue 1456 muddying things up.