You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Hewson (JIRA)" <ji...@apache.org> on 2015/03/24 19:52:55 UTC

[jira] [Comment Edited] (PDFBOX-2727) Cache color space instances

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

John Hewson edited comment on PDFBOX-2727 at 3/24/15 6:52 PM:
--------------------------------------------------------------

PDResources isn't the right place to do caching, it needs to be further downstream. It was explicitly removed in PDFBOX-2370 and I have a patch in-progress to replace it. I've noticed that caching of color spaces is really the only thing which has a significant impact on performance, so we might want to start by just caching those, however PDResources isn't the place to do it.


was (Author: jahewson):
PDResources isn't the right place to do caching, it needs to be further downstream. It was explicitly removed in PDFBOX-2370 and I have a patch in-progress to replace it. I've noticed that caching of color spaces is really the only think which has a significant impact on performance, so we might want to start by just caching those, however PDResources isn't the place to do it.

> Cache color space instances
> ---------------------------
>
>                 Key: PDFBOX-2727
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2727
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: Petr Slaby
>            Priority: Minor
>         Attachments: 000435.pdf, PDResources.java.patch
>
>
> I have a PDF from a customer which contains a lot of calls of SetNonStrokingColorSpace and SetStrokingColorSpace. Each time, an embedded color profile resource is loaded via ICC_Profile.getInstance(InputStream). I have attempted to cache the result in PDResources.java as shown in the attached patch. For this particular PDF, this change improves the performance of PDFToImage from 27 seconds down to 5 seconds (the PDF has two pages). I cannot share the customer PDF, so I have attempted to find a similar free one. Unfortunately, in my test suite, I did not find anything with a comparable improvement. The best example I found is in the attached PDF. There the improvement is from 4.9 seconds without caching to 4.1 with caching.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org