← Back to team overview

qpdfview team mailing list archive

Re: Accelerate huge file opening

 

Hello again,

could you give trunk revision 1992 a try? It moves loading of
interactive elements out of the main event loop so that one can begin to
work with the document even though it will take quite some time to check
every page for annotations and form fields.

I am not completely happy with the result yet because...
* ...it takes quite some time just to load all pages just enqueuing
those tasks. Have to find out where most of the time is spent.
* ...it will now take even longer to load all interactive elements which
will for example block closing the document since these tasks are not
cancellable. But at least it does not impede reading the document.

There a probably various way to improve upon this:
* Use a single task over all pages instead of a task per page which
could remove some load from the task queuing mechanism. But it also
implies a more complicated collaboration between the document view and
the page items.
* Really load interactive elements lazily, i.e. only when the page in
question is shown at least once. This should speed opening the document
and also reduce memory consumption. But I have to see whether this makes
it problematic if the elements pop up during reading. Maybe it will work
well combined with prefetching.

I am grateful for any feedback on these changes and I think I will look
into lazy loading next...

Best regards, Adam.

Am 20.03.2016 um 12:43 schrieb Adam Reichold:
> Hello Arnaud,
> 
> trying the document, the problem seems to be that while we do load the
> interactive elements (links, annotations, form fields) asynchronously,
> we do so using the main event loop. With the more than one thousand
> pages of that document, this keeps the event loop rather busy which
> makes the program unresponsive during that time. (Loading all pages at
> the beginning still does take some time, but not that much more than the
> two seconds it seems.)
> 
> Probably the next best solution would be to load the interactive
> elements on separate threads, e.g. using QtConcurrent, and only insert
> them using the main event loop. I'll have a look of how that works out...
> 
> Best regards, Adam.
> 
> Am 20.03.2016 um 10:00 schrieb Arnaud Schmittbuhl:
>> Hi,
>>
>> Is there any possibility to accelerate huge file opening?
>>
>> More precisely, I take a long time (43 seconds) to open the tikz
>> manual (a latex user will know what I am talking about
>> https://www.ctan.org/pkg/pgf, 11.2 Mo pdf) with my computer whereas it
>> is almost immediate (2 s) with evince.
>>
>> Thanks in advance,
>>
> 
> 
> 

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References