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

Tilman Hausherr commented on PDFBOX-1996:
-----------------------------------------

I don't get it - for the sample file, the result is not a 1 element int[] but a 
4 element int[] that would be the value of the map.

Btw the speed improvement is amazing, the first three pages are rendered in 
20secs with the existing method, and slightly < 2secs with the hash map. Using 
Float as the key instead of that weird "Float.floatToIntBits" trick makes it 
slower, now the time is about 3 secs.

> PDSeparation optimization
> -------------------------
>
>                 Key: PDFBOX-1996
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1996
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: Dave Smith
>            Priority: Minor
>         Attachments: pdfbox.patch, pdfbox.patch
>
>
> I have a 4 page black and white pdf that takes 32 seconds (8 seconds a page) 
> to render. It uses a Separation color space and it has to run numerous 
> functions per pixel that is causing the slow down. I have a patch where I pre 
> calculate the black and white pixels and cache them instead of calculating 
> them every time. This optimization gets the page rendering down to less than 
> a second a page. I will attach my patch. I could see going forward caching 
> all calculated colours , but floats in hash maps are tricky.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to