[ 
https://issues.apache.org/jira/browse/PDFBOX-4411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16731938#comment-16731938
 ] 

Itai Shaked commented on PDFBOX-4411:
-------------------------------------

Looking also at the file from PDFBOX-4149 it appears another place where color 
spaces aren't being cached is when used from within {{PDShading}} . However, 
adding the necessary caching only speeds up the rendering of the file in 
PDFBOX-4149 by ~1%, whereas this patch alone speeds up the rendering of the 
file in PDFBOX-4392 by 50% (cutting rendering time in half), so perhaps it's 
not worth it, unless there are examples of files re-using color spaces 
extensively within shading... 

> Support caching of ICC based color spaces
> -----------------------------------------
>
>                 Key: PDFBOX-4411
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4411
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.13
>            Reporter: Itai Shaked
>            Priority: Major
>         Attachments: Cache_PDICCBased_color_spaces.patch
>
>
> Following up on PDFBOX-4392 I have noticed ICC color spaces aren't being 
> cached in the resource cache, since they are represented not by a `COSObject` 
> but rather by a `COSArray` with `COSName` of `ICCBased` as the first element 
> and a `COSObject` (the actual profile) as the second element.  
> This patch introduces a static `create` method to `PDICCBased` which 
> optionally caches/retrieves the color space from cache. Accordingly, the 
> constructor taking a `COSArray` has been made private, and the validity tests 
> moved to the static `create` method.   
> Testing on the example from PDFBOX-4392 the patch improves both time and 
> memory consumption. Presumably it will help with any PDF with ICC-based 
> profiles which are re-used by many images. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to