Bug 96728 - pdftops needs hours to convert this 10MB pdf
Summary: pdftops needs hours to convert this 10MB pdf
Alias: None
Product: poppler
Classification: Unclassified
Component: splash backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
Depends on:
Reported: 2016-06-29 15:02 UTC by Urs
Modified: 2018-08-20 21:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

sample pdf (9.22 MB, application/pdf)
2016-06-29 15:02 UTC, Urs
valgring --tool=callgrind okular runsforever-poppler.pdf (866.30 KB, application/octet-stream)
2018-05-17 00:53 UTC, Stefan Brüns

Description Urs 2016-06-29 15:02:38 UTC
Created attachment 124780 [details]
sample pdf


Attached pdf lets pdftops 0.45.0 work 2 1/2 hours on the conversion to Postscript on 64-bit Linux.
command: pdftops runsforever-poppler.pdf

$ date
Wed Jun 29 13:58:40 CEST 2016
$  pdftops runsforever-poppler.pdf
$ date
Wed Jun 29 16:28:46 CEST 2016

The original PDF is 10MB, the resulted .ps 67MB

Most pdf files can be converted withing few minutes with pdftops.
It looks like pdftops is looping somewhere or some recursion or loop is not implemented optimally.

Is it possible that this will be corrected in the near future?

Thank you

Urs Beckmann
ETH Zürich
ITS Printing
STB H 14
044 6323488
Stampfenbachstr. 69
8092 Zürich
Comment 1 Stefan Brüns 2018-05-17 00:49:29 UTC
This is an particularly "unfriendly" PDF.

It contains a vectorial map, the map shows several hundreds of trees, and each tree crown is drawn as hundreds of branches.

Apparently the trees are drawn as lineart.

According to valgrind, the majority of the time is spent calculating path intersections, i.e. in SplashXPathScanner::computeIntersections(...).

Not only pdftops is slow, but also okular, thus I have changed the component.
Comment 2 Stefan Brüns 2018-05-17 00:53:13 UTC
Created attachment 139603 [details]
valgring --tool=callgrind okular runsforever-poppler.pdf
Comment 3 Stefan Brüns 2018-05-20 12:47:46 UTC
I think this can be marked as a duplicate of 78728
Comment 4 Albert Astals Cid 2018-05-21 08:29:32 UTC
Don't assign bugs to me. you remove them from the mailing list and people stop receiving the emails.

Are you sure pdftops slowdown has to do with SplashXPathScanner too?
Comment 5 Stefan Brüns 2018-05-24 14:57:53 UTC
AFAICS pdftops rasterizes the whole document, so this seems reasonable.

I am currently running pdftops inside valgrind, this may take some more hours ...
Comment 6 Albert Astals Cid 2018-05-24 17:27:43 UTC
(In reply to Stefan Brüns from comment #5)
> AFAICS pdftops rasterizes the whole document, so this seems reasonable.

It tries very hard not to do that, but in some cases (like when there are transparencies that afaik are not supported in ps) it has to.
Comment 7 GitLab Migration User 2018-08-20 21:45:26 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/57.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.