diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2022-09-15 15:32:00 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2022-09-15 15:32:57 +0100 |
commit | 85277d1dd24c5eebf4579ae22c54fb9b25683c9d (patch) | |
tree | 7c3d5e5a53a7c83b3d1daff3401968af521e6b6a /Resource | |
parent | da5f7e159cf9ab077b530427dc871e45a15d30da (diff) | |
download | ghostpdl-85277d1dd24c5eebf4579ae22c54fb9b25683c9d.tar.gz |
GhostPDF + GS - performance improvement with transparent files and clist
The way that the graphics library 'caches' ICC profiles when we are
using a clist is somewhat arcane. We retain a profile and link cache in
the device's 'clist' portion of the structure. As we find profiles we
add them to the profile cache and as we create link profiles we add
them to the link cache (profiles are written to and read from the clist)
For subsequent pages we (whether by design or accident) rely on the
device's clist caches remaining unchanged to give us a performance
benefit.
However with pdfi we were grestore'ing back to a point before we had
set 'PageUsesTransparency' in the device, then going back around and
setting it back up again.
Because we use that to control the banding, the fact that it had
changed caused us to throw away the clist, and then recreate it, which
threw away the ICC caches, which meant we had to recreate the link
profiles, from the profiles stored in the clist, on every page.
For /tests_private/pdf/PDFIA1.7_SUBSET/CATX3146.pdf and possibly for
other files this was a very significant portion of the total time
taken for the entire job (it is otherwise a comparatively simple file)
By removing the gsave and grestore pair we can avoid restore'ing back to
a time when the device's PageUsesTransparency flag was false, which
avoids us discarding and recreating the clist, which means we keep the
caches and therefore the file runs faster. This may affect other files
at certain resolutions/configurations.
command line:
-q -dQUIET -dNONATIVEFONTMAP -dSAFER -dBATCH -r72 -dJOBSERVER -sDEVICE=bit -o /dev/null /tests_private/pdf/PDFIA1.7_SUBSET/CATX3146.pdf
Diffstat (limited to 'Resource')
-rw-r--r-- | Resource/Init/pdf_main.ps | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps index 4aa2595f9..cf1825dfb 100644 --- a/Resource/Init/pdf_main.ps +++ b/Resource/Init/pdf_main.ps @@ -1013,7 +1013,6 @@ currentdict /PDFSwitches undef /newpdf_pdfshowpage_init { - gsave } bind def /newpdf_pdfshowpage_setpage @@ -1042,7 +1041,6 @@ currentdict /PDFSwitches undef ( Could not draw this page at all, page will be missing in the output.\n) newpdf_pdfformaterror } if }ifelse - grestore } bind def /newpdf_pdfshowpage |