Bug 415400 - Okular stumbles while scrolling through a heavy epub
Summary: Okular stumbles while scrolling through a heavy epub
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: EPub backend (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-20 16:05 UTC by Alexander
Modified: 2020-02-23 11:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander 2019-12-20 16:05:07 UTC
SUMMARY
Okular never stumbles during scrolling through pdf documents. It may temporary show a blank page but allows you to scroll pages further smoothly.

Okular jerks and stumbles while scrolling through a heavy epub or fb2 document (perhaps other types of documents too). It is very unpleasant experience. As far as I can tell it happens even on decent contemporary hardware which, without a doubt, should allow to scroll through a 2.5MB ~1500 pages document smoothly.

STEPS TO REPRODUCE
I actually tried to read this book:
https://rutracker.org/forum/viewtopic.php?t=5608295
I could attach it here but I'm not sure whether it would be a copyright issue or not.
The way the smooth scrolling of Okular were interrupted by page loading irritated me so much that I ended up converting this book to pdf (using Calibre) and reading it in pdf form.
Comment 1 Albert Astals Cid 2019-12-28 22:57:56 UTC
Yeah, the text generators are not threaded.

There's a few 
#ifdef OKULAR_TEXTDOCUMENT_THREADED_RENDERING
around the code but never enabled, i guess Pino didn't feel it was safe enough.

Someone should find time to finish the feature
Comment 2 Alexander 2020-01-08 00:15:12 UTC
1) I don't understand how a plaintext document can be rendered so inefficiently.
It takes time for Okular to do pagination of a book, which, AFAIK do not have a notion of a page (fb2, mobi), it's OK. But then it stumbles over each page! A page with about 40 rows of text on it.
On my Acer C720 Okular freezes completely for about a second, then has about 3 seconds of considerably deteriorated performance.
It doesn't take so much time to render a similar or even more complex pdf page.
Only pdf pages with complex graphics take much time to render.

2) If a user was patient enough and slowly scrolled through some pages they become quickly accessible. Kind of "pre"-loaded. User can scroll smoothly back and forth in the range of these pages. So, maybe some kind of prefetch could be done to improve performance? Maybe even all book could be situated in RAM in a form suitable for rendering? Does it take too much RAM?
By the way, Okular Settings [Configure Okular -> Performance -> Memory Usage] seem does nothing for non-pdf formats.
Comment 3 Albert Astals Cid 2020-01-08 21:39:41 UTC
> I don't understand how a plaintext document can be rendered so inefficiently.

I'm eagerly awaiting your patches that will make everything so much better.