Bug 153675

Summary: pre-loading doesn't work properly
Product: [Applications] okular Reporter: Armin Berres <armin>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Armin Berres 2007-12-08 13:44:25 UTC
Version:            (using KDE KDE 3.96.0)
Installed from:    Compiled From Sources
OS:                Linux

There are two nasty bugs in kpdf which are still present in okular.
https://bugs.kde.org/show_bug.cgi?id=102528 and https://bugs.kde.org/show_bug.cgi?id=147977
I have my memory usage set to aggressive and the following happens:
When I open a document in non-continuous mode the next page is never pre-loaded. When I have a document with large slides I always have a delay of about a second before the slide is completely shown. When I go back one page is cached. If I go back two pages okular must render the page again, even if it was already shown before. I have 1.25G Ram and more than half of it is still free.

In continuous mode things are a bit better: Pages which have been shown are kept in memory don't have to be rendered again and the next page is pre-loaded. But if you go forward more than one page you have the delay again.

My wish: Okular should keep already rendered pages in memory and it should pre-load more than one of the next pages (I wouldn't mind if it'd pre-load 50 pages if there's enough memory). When viewing slides it is not uncommon to switch between slides really fast, which is not really possible right now.
Comment 1 Pino Toscano 2007-12-31 18:35:39 UTC
SVN commit 755216 by pino:

Change the page layouting procedure so:
- pages not in the view (wth no Continuous mode active) are just "hidden", but they now have a valid size;
  this way, we can preload "hidden" pages even when in Continouos mode
- merge the layouting methods (simplify a bit)

CCBUG: 153675


 M  +35 -121   pageview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=755216
Comment 2 Jaan Vajakas 2008-01-19 14:10:39 UTC
It seems that unlike KPDF, Okular holds in cache only the page before and the page page after the current page. With KPDF, if I have visited all the pages then all the pages remain in the cache, so that the contents of the pages is shown when I scroll fast through the document in continuous mode. But Ocular shows blank pages at first and I must wait a second before I can see the contents.

I wish Okular also held visited pages in cache, like KPDF.

I use KPDF 0.5.7 and Okular 0.6 on openSUSE 10.3 x86_64. I have the same options for both KPDF and Okular in the Performance panel: transparency effects and background generation are enabled and memory usage is set to aggressive.
Comment 3 Albert Astals Cid 2008-04-27 20:06:52 UTC
SVN commit 801781 by aacid:

Correctly calculate the amount of memory to free, should fix bug 153675
BUGS: 153675


 M  +14 -7     document.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=801781
Comment 4 Armin Berres 2008-04-30 14:44:52 UTC
First: Good work.
Second: The bug is not completely fixed yet. Caching of once rendered pages perfectly works now, but preloading of not rendered pages doesn't work yet. That's why I reopen the bug.
It would be quite nice, if Okular would preload some of the next pages. Viewing PDF presentations (you often want to change the slides very fast) would get much more convenient :)

Thanks for the work on Okular!
Comment 5 Albert Astals Cid 2008-05-03 14:37:48 UTC
Well, we preload next and previous pages if you are on normal or aggresive memory modes and if you are on aggresive memory mode we make sure they don't get kicked out of the page cache by our "memory freeing algorithm".

If you want to increase the number of preloaded pages, please open a wishlist report.