Bug 691897 - Very slow rendering of stroke with thousands of subpaths.
Summary: Very slow rendering of stroke with thousands of subpaths.
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Graphics Library (show other bugs)
Version: master
Hardware: All All
: P4 normal
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-18 18:09 UTC by Ray Johnston
Modified: 2011-10-02 02:35 UTC (History)
0 users

See Also:
Customer: 532
Word Size: ---


Attachments
14.pdf (1.12 MB, application/pdf)
2011-01-18 18:09 UTC, Ray Johnston
Details
14_Coupe-profile.txt (1.19 MB, text/plain)
2011-01-18 19:43 UTC, Ray Johnston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Johnston 2011-01-18 18:09:40 UTC
Created attachment 7136 [details]
14.pdf

Command line:

gs -r600 -sDEVICE=ppmraw -dBandHeight=128 -o nul: -Z: 14.pdf

This reports (on a 1.6GHz Celeron):
   % Outputpage start time = 8.359
   % Outputpage end time = 143.859

Note that running with -dNOTRANSPARENCY completes in 16.594 sec
Comment 1 Ray Johnston 2011-01-18 19:43:36 UTC
Created attachment 7138 [details]
14_Coupe-profile.txt

Profile of the entire file (14_Coupe_T2_Atelier_2-file.pdf) on peeves using
a 'pg' build and gprof. Different than what 'sleepy' showed on Windows, but
MUCH more trustworthy
Comment 3 Robin Watts 2011-01-19 18:04:10 UTC
Fixed in revision 12038.

The code contains an optimisation to allow us to spot the case where strokes are being rendered solid with a normal blend mode, and to allow us to use the fast path through the code. In this case we were using "compatible" blend mode, which is supposed to be the same as normal, but wasn't triggering the fast code.

The fix is simply to map "Compatible" -> "Normal" within the code.
Comment 4 Ray Johnston 2011-01-19 19:00:07 UTC
The change allows me to run the 14_Coupe... file that used to take 212 seconds
to complete in 28 seconds (on the same glacial laptop).

I suggest adding a comment about what we are doing and why. For example:

    /* Map Compatible to Normal so other code treats Compatible as Normal */
    /* Often BLEND_MODE_Normal is checked for optimized handling, and     */
    /* Compatible is now specified to be the same.                        */
Comment 5 Robin Watts 2011-01-19 20:37:04 UTC
Comment committed as part of revision 12039. Thanks.