Why is my PDF scroll and search so slow?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

jacques01
Posts: 42
Joined: Thu Oct 08, 2015 4:56 am UTC

Why is my PDF scroll and search so slow?

Postby jacques01 » Sun Jun 12, 2016 3:04 pm UTC

I'm looking over an approximately 600 page PDF file, stored on my local machine. I'm using OS X Preview app to view it.

There is significant delay when scrolling the page, and also doing text searches. I'm surprised because I didn't think the code involved with scrolling a PDF document and performing searches would be very computationally expensive.

Here's the stats of my machine:

Model Name: MacBook Pro
Processor Name: Intel Core i7
Processor Speed: 2.4 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 8 GB


Now, for the folks who work for/with Adobe or PDF, is there a reason why viewing a PDF in 2016 should be slow / problematic?

Or is this a problem with my viewing client, e.g. if I used a different App to view the PDF, would it be faster?

BedderDanu
Posts: 39
Joined: Tue Jan 14, 2014 6:18 am UTC

Re: Why is my PDF scroll and search so slow?

Postby BedderDanu » Sun Jun 12, 2016 4:00 pm UTC

I would try another app first. I don't own a mac, but it could be one of the two following problems:

1. The app is only opening one page at a time, and fetching each page fresh from the hard drive. It may detect that the 600 pages is too big to deal with in one go, which might be causing this scrolling delay. Another app might handle the scrolling better, like loading a thumbnail for each page and using that to represent scrolling, loading only the final page you land on.

2. The PDF you are using might not have text in it if it was a scan. The app could be trying to do real time OCR on the image as it loads each page. Another app might do this differently.

Again, I don't own a mac, so I'm shooting in the dark.

User avatar
Xanthir
My HERO!!!
Posts: 5198
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Why is my PDF scroll and search so slow?

Postby Xanthir » Sun Jun 12, 2016 6:30 pm UTC

I find that universally, PDF readers are terrible for no good reason. A perfectly equivalent web page would scroll/etc vastly better. Very annoying when trying to, say, use a D&D pdf to play from. :/
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

commodorejohn
Posts: 935
Joined: Thu Dec 10, 2009 6:21 pm UTC
Location: Placerville, CA
Contact:

Re: Why is my PDF scroll and search so slow?

Postby commodorejohn » Mon Jun 13, 2016 2:33 am UTC

Xanthir wrote:I find that universally, PDF readers are terrible for no good reason. A perfectly equivalent web page would scroll/etc vastly better. Very annoying when trying to, say, use a D&D pdf to play from. :/

Pretty much this. Outside of SumatraPDF (lightweight and pleasant) and mupdf (supremely bare-bones but no-bullshit) every PDF reader I've encountered has been awful. Of course, Acrobat (sorry, sorry, Adobe) Reader itself is King of Trash Mountain in that contest, but there's plenty of other worthy contenders.
"'Legacy code' often differs from its suggested alternative by actually working and scaling."
- Bjarne Stroustrup
www.commodorejohn.com - in case you were wondering, which you probably weren't.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Why is my PDF scroll and search so slow?

Postby troyp » Tue Jun 14, 2016 10:54 pm UTC

Zathura is an excellent lightweight PDF viewer if you don't need advanced features. It should be available on MacPorts.

MuEta
Posts: 15
Joined: Tue Dec 22, 2015 2:44 pm UTC

Re: Why is my PDF scroll and search so slow?

Postby MuEta » Fri Jun 17, 2016 3:39 pm UTC

But Adobe Acrobat comes packaged with Google Ultron, and we all know that that is the greatest browser to ever exist!


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 6 guests