Papers wastefully tries rendering every page while pressing and holding the (Ctrl+) PageUp / PageDown buttons
For various reasons, some users like @maymage wish to be able to "press and hold" the PageUp
/ PageDown
(and/or Ctrl+PageUp
/ Ctrl+PageDown
) keys, to flick through a large document without using the (more granular) Up
/ Down
keys, the scrollbar/scrollwheel, or the page number jump feature or the sidebar's ToC or search.
Currently, doing so will destroy performance in the same way it would on Evince (and to an extent, Okular)… not because Poppler is particularly slow there, but because we're spamming it with useless, wasteful requests to render.
It is 100% wasteful to do so because:
-
PgUp
/PgDown
scroll is so fast that the human eye cannot reasonably perceive any contents scrolling by; - you're just rendering stuff to throw it away / out-of-the-view within a tenth of a second;
- meanwhile you are heating up the CPU, wasting battery power, spamming the compositor / graphics stack, filling up the RAM with images bitmaps, etc.
My recommendation, in this specific case of "warp-speed scrolling" (not regular scroll, and not Up
/Down
keys), is to do this instead:
The page view's scrollbar (and sidebar's scrollbar) should still be connected to the press (or whatever event/signal that we're using now) event/signal, but the actual "request to render thumbnails and pages" should be inhibited by being only connected to the release
event (or a scroll done event, or when reaching a slow-enough scroll speed, such as in the case of decelerating kinetic motion like in #78 (closed)), and only for the current pages at which the user stops paging.