Bug 689153 - Performance problems reading PDF file
Summary: Performance problems reading PDF file
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Color (show other bugs)
Version: 8.56
Hardware: PC Linux
: P2 normal
Assignee: Michael Vrhel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 19:56 UTC by Marcos H. Woehrmann
Modified: 2011-09-18 21:46 UTC (History)
1 user (show)

See Also:
Customer: 850
Word Size: ---


Attachments
patch (1.50 KB, patch)
2007-08-12 10:43 UTC, Alex Cherepanov
Details | Diff
PerformanceAnalysis.pdf (340.25 KB, application/pdf)
2010-02-18 10:42 UTC, Dave Eberly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2007-03-26 19:56:20 UTC
The attached PDF file loads very slow in Ghostscript; the newer the Ghostscript
the slower.

Displaying the file on the screen at equivalent sizes (-r24 for Ghostscript):

gs8.53   4:25
gs8.54   5:43
gs8.56   9:57
acroread 0:26

All of the results look identical.
Comment 1 Marcos H. Woehrmann 2007-03-26 19:57:57 UTC
Created attachment 2858 [details]
9322.pdf
Comment 2 Thomas DiGennaro 2007-03-28 09:57:43 UTC
We need to find out what causes the performance problem.
Comment 3 leonardo 2007-03-31 22:05:31 UTC
Acrobat 7 on WinXP spends 25 seconds to open it on a Zeon 3.05 GHz machine.
Comment 4 leonardo 2007-03-31 22:17:12 UTC
The document defines 250000+ images.
Comment 5 leonardo 2007-03-31 23:08:26 UTC
It is an image rendering problem. The last slowdown may be caused by the color 
space patch http://ghostscript.com/pipermail/gs-cvs/2007-March/007345.html (I 
didn't test for sure). Passing to image specialist.
Comment 6 Alex Cherepanov 2007-08-12 10:43:15 UTC
Created attachment 3275 [details]
patch

Use inline and intristic functions to improve the speed of CIE cache set-up.

This speeds up the sample file processing by 10% on GCC, release build.
There's little room for further low level optimization.

The sample file has a large number of small images that use ICCBased color
space, the same for all images. Setting up CIE cache for every image takes
about
a half of the running time. We need to cache the CIE caches to achieve
significant results.
Comment 7 Alex Cherepanov 2007-08-12 12:30:09 UTC
The patch is committed as a rev. 8184.
Regression testing shows no differences.
Comment 8 Ralph Giles 2008-05-20 16:32:41 UTC
Looks like this is fixed.
Comment 9 Alex Cherepanov 2008-05-20 18:43:05 UTC
Current HEAD takes about 1 hour to process the file on a mid-range PC.
The main problem is not fixed.
Comment 10 Michael Vrhel 2008-07-16 11:58:21 UTC
This type of file (one with a lot of images with ICC profiles) will be handled
much more efficiently when we implement the new ICC based work flow.  The
specification for this new flow is currently under development.  The approach
will be to have a small cache of recently used linked transforms that could be
applied to the data in one single step, versus the multi-step transformation
that occurs today for this case.
Comment 11 Michael Vrhel 2010-02-16 11:10:19 UTC
Reassigning to Dave to look at the primary source of delay in this file.  It
would also be interesting to see how this file behaves with the ICC branch.
Comment 12 Dave Eberly 2010-02-18 10:42:17 UTC
Created attachment 5967 [details]
PerformanceAnalysis.pdf

The PDF attachment describes the performance problem.  The function
check_interpolation_required is called 2.3 billion times (it is inlined, but
makes no difference), which appears to be excessive.  The
garbage-collection-related function gc_trace is also expensive, but I do not
know whether this is a side effect of the aforementioned problem.
Comment 13 Ray Johnston 2010-02-18 11:08:58 UTC
Since Michael is working on replacing ALL of the CIE code with ICC color
conversion using 'link' profiles directly from the source to the destination
color space, this is probably best left as a test for the ICC branch.

Thanks for the analysis, Dave. If this runs on the icc_work branch, can
try that and if it is still very slow, repeat the performance analysis?
Comment 14 Michael Vrhel 2010-07-02 18:22:19 UTC
With the merge of the icc branch, this renders in a reasonable amount of time.  About 2 minutes at 72dpi and 2 minutes 30 seconds at 300dpi on my laptop (2.4 GHz 32 bit)
Comment 15 Marcos H. Woehrmann 2011-09-18 21:46:48 UTC
Changing customer bugs that have been resolved more than a year ago to closed.