Bug 317891 - Okular takes >1 min to open some pdf files
Summary: Okular takes >1 min to open some pdf files
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.19.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 333999 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-05 17:58 UTC by Dave Lepore
Modified: 2014-11-20 14:17 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 Dave Lepore 2013-04-05 17:58:50 UTC
I have some pdf presentations (made with beamer) which have from ~800 to ~1100 slides and weight 3.7MB. When I open the pdf with muPDF, Evince or Acrobat Reader 9 for Linux the content shows up almost instantly, while when I open it with Okular it takes > than 1 minute for the contents to show up. 
This happens with an Atom CPU, if I open the same file on a i7 PC it takes less than 1 minute but still considerably more than other readers and way too much time considering it's an i7 PC. 

Setting the "greedy" option makes no difference. 
Please let me know how can I attach one of the files so that devs may tray it.

Reproducible: Always

Steps to Reproduce:
1. open the attached pdf
2.
3.
Comment 1 Albert Astals Cid 2013-04-05 18:18:50 UTC
Use the "Add an attachment" or the file is too big for it?
Comment 2 Dave Lepore 2013-04-05 19:10:31 UTC
I'm not sure, I tried several times but i get a timeout error. May I send the file somewhere else?
Comment 3 Dave Lepore 2013-04-05 19:25:02 UTC
uploaded here: http://www.speedyshare.com/ry2Az/test.pdf
Comment 4 Albert Astals Cid 2013-04-05 20:40:14 UTC
Got it, will have a look when get some time
Comment 5 Albert Astals Cid 2013-05-20 16:53:18 UTC
Just that i don't forget for the future. Seems like something inside  poppler-qt4 is resolving lots of named destinations, which doesn't make much sense, named destinations should be resolved on "use" time.
Comment 6 Albert Astals Cid 2014-05-08 10:42:57 UTC
*** Bug 333999 has been marked as a duplicate of this bug. ***
Comment 7 Albert Astals Cid 2014-05-08 10:44:57 UTC
Solution: We need to add to poppler a way to get the annotations but excluding the LinkAnnotations. For these kind of files, getting the LinkAnnotations is expensive and what is more interesting, we don't use them on the Okular side, so it's just wasted time ^_^
Comment 8 Albert Astals Cid 2014-05-11 16:45:08 UTC
Git commit 19a216a275859e38a12524ee988948a5a2c2eb27 by Albert Astals Cid.
Committed on 11/05/2014 at 16:43.
Pushed by aacid into branch 'master'.

Don't ask for link annotations, they are slow and we don't use them

Needs poppler 0.28 that is yet to be released

M  +15   -3    cmake/modules/FindPoppler.cmake
M  +3    -0    generators/poppler/config-okular-poppler.h.cmake
M  +18   -0    generators/poppler/generator_pdf.cpp

http://commits.kde.org/okular/19a216a275859e38a12524ee988948a5a2c2eb27
Comment 9 Markus Trippelsdorf 2014-05-12 10:37:07 UTC
Thanks Albert.

I've tested Okular trunk with poppler trunk (by just defining HAVE_POPPLER_0_28)
and it loads pdfs much faster now.

Here's a document that still loads somewhat slowly on my machine: trippelsdorf.de/style.pdf
Please take a look if you find time.
Comment 10 Albert Astals Cid 2014-05-12 10:42:00 UTC
Please open a new bug.
Comment 11 Markus Trippelsdorf 2014-05-12 10:48:08 UTC
(In reply to comment #10)
> Please open a new bug.

It takes ~4 seconds to open that document. I can live with it.
Lets just drop the issue, because it's not that important.
Comment 12 Dave Lepore 2014-11-09 11:57:00 UTC
I just updated to poppler 0.28.1 but I still see noticeable delays for many PDFs. Consider for example the PGF manual (which has lots of internal links) http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf

with muPDF it opens in less than a second, with Okular it takes 30 secs with a intel i7, much more with a netbook processor. 

Should I file another bug?
Comment 13 Markus Trippelsdorf 2014-11-09 12:00:54 UTC
(In reply to Dave Lepore from comment #12)
> I just updated to poppler 0.28.1 but I still see noticeable delays for many
> PDFs. Consider for example the PGF manual (which has lots of internal links)
> http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf
> 
> with muPDF it opens in less than a second, with Okular it takes 30 secs with
> a intel i7, much more with a netbook processor. 
> 
> Should I file another bug?

It opens almost immediately for me.
Comment 14 Albert Astals Cid 2014-11-09 15:07:37 UTC
Do you have the problem with the file that was attached here? If not, open a different bug.
Comment 15 Dave Lepore 2014-11-10 21:28:31 UTC
I still have the problem with the file (that was) attached here. It seems to me that it is the same problem as of the PGF manual. Does the PGF manual opens instantly for you? I fear it may be a local problem here... Is there something I can do to check if it is a local problem?
Comment 16 Markus Trippelsdorf 2014-11-10 21:34:48 UTC
(In reply to Dave Lepore from comment #15)
> I still have the problem with the file (that was) attached here. It seems to
> me that it is the same problem as of the PGF manual. Does the PGF manual
> opens instantly for you? 

Yes.

>I fear it may be a local problem here... Is there something I can do to check if it is a local problem?

Well, as I wrote in comment 9, you need to make sure HAVE_POPPLER_0_28 is defined.

I used the following patch:

diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake
index 6389a625d3ba..429024bcfd2e 100644
--- a/cmake/modules/FindPoppler.cmake
+++ b/cmake/modules/FindPoppler.cmake
@@ -129,8 +129,6 @@ check_cxx_source_compiles("
 #include <poppler-qt4.h>
 int main()
 {
-  Poppler::Page *p = 0;
-  p->annotations( QSet<Poppler::Annotation::SubType>() << Poppler::Annotation::ASound );
   return 0;
 }
 " HAVE_POPPLER_0_28)
Comment 17 Albert Astals Cid 2014-11-10 21:40:57 UTC
Why would you do that? You're essentially removing the check for 0.28
Comment 18 Markus Trippelsdorf 2014-11-10 21:44:18 UTC
(In reply to Albert Astals Cid from comment #17)
> Why would you do that? You're essentially removing the check for 0.28

Sorry, I can't remember, just found the diff in my git tree. So it was necessary at one point.
Comment 19 Albert Astals Cid 2014-11-10 22:17:58 UTC
Markus, if you don't know why youre suggesting things, please don't.

Dave, are you sure you have recompiled okular after installing poppler 0.28?
Comment 20 Dave Lepore 2014-11-10 22:37:11 UTC
I installed poppler via the Archlinux packages, I think the problem might be that the okular package has not been rebuilt after poppler was upgraded. Will check with the mantainers and report back.
Comment 21 Dave Lepore 2014-11-20 14:17:52 UTC
So, after a rebuild everything works fine. Sorry for the noise and thanks for fixing this.