summaryrefslogtreecommitdiff
path: root/Resource
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2021-03-20 20:00:33 -0700
committerRay Johnston <ray.johnston@artifex.com>2021-03-22 08:49:49 -0700
commit0583cf70c06e8041af1a639e7e3ee6e41ecb2b76 (patch)
treeb36f4f26802fc86fefdae476d495ffd63a6ace57 /Resource
parentb56601e4efbe3e3c63e8815373b63efea8936dd2 (diff)
downloadghostpdl-0583cf70c06e8041af1a639e7e3ee6e41ecb2b76.tar.gz
Fix a performance regression introduced by commit 813b5f48e8
The fix is to keep the PageUsesOverprint parameter in the device dictionary, not in the outer dictionary, and use it from there. It isn't understood why storing in the outer dictionary causes such a substantial performance hit, but profiling shows that the time comes from "dstack_find_name_by_index". The performance hit showed up with j9_acrobat.pdf of the performance test suite (about 8%).
Diffstat (limited to 'Resource')
-rw-r--r--Resource/Init/pdf_main.ps16
1 files changed, 6 insertions, 10 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index 40ab25959..ded2782a1 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -2774,13 +2774,10 @@ currentdict /PDF2PS_matrix_key undef
1 index /ProcessColorModel get /DeviceCMYK eq {
PageSpotColors 0 gt % count of colorants NOT including CMYK
and
- } {
- } ifelse
+ } if
/PageUsesOverprint exch def % the page needs OP simulation so set device param.
} if
- pop PageUsesOverprint currentdict end
- setpagedevice
- /PageUsesOverprint exch def % tuck it away in the pagedict
+ pop currentdict end setpagedevice
} bind executeonly def
/.free_page_resources { % - .free_page_resources -
@@ -2858,10 +2855,10 @@ currentdict /PDF2PS_matrix_key undef
/devColors exch def % put into our convenience dict
dup /HaveTransparency .knownget not { //false } if
/devSupportsTrans exch def % put into our convenience dict
- /Overprint get
+ dup /Overprint get
/SimOP exch def % put into our convenience dict
SimOP /simulate eq
- PageUsesOverprint
+ exch /PageUsesOverprint .knownget not { //false } if
and % both Overprint==/simulate and PageUsesOverprint
{
% Determine if the device needs the special pdf14 compositor push
@@ -2871,7 +2868,6 @@ currentdict /PDF2PS_matrix_key undef
} {
//false % Overprint is not /simulate or PageUseOverprint is false
} ifelse
-
% Determine if the device needs SMask for Overprint
SimOP /simulate eq {
//true % we will need setupOPrtans for Compatible BM
@@ -2920,9 +2916,9 @@ currentdict /PDF2PS_matrix_key undef
% push a pdf14devicefilter to handle the overprint simulation using the pdf14 device.
currentpagedevice
dup /Overprint get /simulate eq
- exch /PageSpotColors known
+ 1 index /PageSpotColors known
not and
- PageUsesOverprint
+ exch /PageUsesOverprint .knownget not { //false } if
and
{
% Show the page within a PDF 1.4 device filter for overprint_simulation.