Discussion:
[gs-bugs] [Bug 698816] - Ghostscript - Performance decrease from 9.20 seen with 32-bit build
b***@artifex.com
2017-12-13 17:41:48 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Bug ID: 698816
Summary: Performance decrease from 9.20 seen with 32-bit build
Product: Ghostscript
Version: master
Hardware: PC
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: P4
Component: Graphics Library
Assignee: ghostpdl-***@artifex.com
Reporter: ***@artifex.com
QA Contact: gs-***@ghostscript.com
Word Size: ---

Created attachment 14533
--> http://bugs.ghostscript.com/attachment.cgi?id=14533&action=edit
Glass_Guardrail_response.pdf

File from customer is 21600x14400 at 600 dpi and shows a significant slowdown
in 9.22 and HEAD going to tiffpack compared to 9.20 and 32-bit is much slower
than 64-bit build.

On my laptop, I tested gswin64c and saw:

ac241e3 16.2
9.22 20.7
9.21 20.0
9.20 14.2

With a 32-bit build, I get slower times:

ac241e3 40.1
9.22 45.6
9.20 16.2

Thus 32-bit is not just slower, but the ratio between 9.20 and 9.22 is worse
(2.8 x).

The improvement from 9.22 to ac241e3 to isn't as good as for the 64-bit build
(13% vs 27%).
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-13 17:42:11 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Ray Johnston <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|ghostpdl-***@artifex.com |***@artifex.com
Customer| |531
Priority|P4 |P1
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-13 17:42:35 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Ray Johnston <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #14533|0 |1
is private| |
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-16 17:53:52 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Ray Johnston <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |IN_PROGRESS

--- Comment #1 from Ray Johnston <***@artifex.com> ---
The primary culprit is commit 3a9d6eb Bug 626295 Text Knockout Transparency

The overall time jumps from 22 sec to 42 sex and the 'sys' time goes from .9
sec
to 11 sec. Interestingly, the 64-bit get 28 sec overall with sys time of 2.1
sec

SHA 04c75ceb vs 3a9d6eb produce identical output for this file

The profiles of the two versions say the total time is 20.6s vs 23.5 seconds,
but the usertime from time is 22.3 vs 31.7 (sys time is 0.5 vs 10.8)

The profile difference shows 9118 vs 465118 calls to begin and end transparency
group, accounting for 1.7 sec of the (profile's) 2.9 sec difference
looking at the debug output, it's REAL ugly. since it doesn't know the
transparency group boundaries, it writes it to a LOT of bands, then during
rendering, it ends up doing push_transparency_group setting trans params and
then popping the transparency group (no marking op) in MOST of the bands.

I'm checking the clist logic to see if we are ignoring the dummy sets properly

I have no idea why the 32-bit vs 64-bit sys time
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-16 18:59:28 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

--- Comment #2 from Ray Johnston <***@artifex.com> ---
Even though there is 'idle' logic in the clist compositor queue elements, it
is not being used to prevent the push/end of the groups. Fixing this is likely
take a bit of time.

I will start work on that on HEAD.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-17 00:22:21 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Ray Johnston <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|IN_PROGRESS |RESOLVED
Resolution|--- |FIXED

--- Comment #3 from Ray Johnston <***@artifex.com> ---
Tracked this down to the push_transparency_group logic not skipping the
allocation of the buffer when "idle" was set. This reduced 32-bit Windows
9.22 from 45.9 seconds to 19.9 seconds.

Even more good news, HEAD (SHA 3f9c130f 32-bit Windows) from 37.5 seconds to
11.9 seconds.

Also 64-bit Windows HEAD builds reduce from 14.3 seconds to 11.3 seconds.

The fix is applicable to both versions:

diff --git a/base/gdevp14.c b/base/gdevp14.c
index d49d912..cf9f3c6 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -834,7 +834,7 @@ pdf14_buf_new(gs_int_rect *rect, bool has_tags, bool
has_alpha_g,
result->parent_color_info_procs->previous = NULL;
result->parent_color_info_procs->encode = NULL;
result->parent_color_info_procs->decode = NULL;
- if (height <= 0) {
+ if (idle || height <= 0) {
/* Empty clipping - will skip all drawings. */
result->planestride = 0;
result->data = 0;

Fixed in commit e8e7034a9714191315313daa4a45ce626a9f6cf7
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-18 17:07:09 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

Ray Johnston <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |NOTIFIED
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-12-18 17:27:17 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698816

--- Comment #4 from Ray Johnston <***@artifex.com> ---
Note that with HEAD (SHA 9fb2361) this patch improves the timing of this file
with 64-bit code from 13.6 to 10.5 seconds (29% improvement).
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...