[ https://issues.apache.org/jira/browse/PDFBOX-2117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14058399#comment-14058399 ]
Tilman Hausherr commented on PDFBOX-2117: ----------------------------------------- I committed the caching of the exponent in rev 1609625 for the trunk and rev 1609627 for the 1.8 branch. Note that the speed gain is just minor compared to your change in the Axial rendering that I haven't committed yet but most likely will. What I like a lot is that yours works also for a diagonal axis of shading. I also committed your optimizations for PDFunction in 1609630 for the trunk and rev 1609632 for the 1.8 branch. IMHO removing the Math() call should have a very slight improvement; don't know about the shift, because java does a lot optimizations by itself. But it certainly won't hurt :-) > AxialShadingContext is slow > --------------------------- > > Key: PDFBOX-2117 > URL: https://issues.apache.org/jira/browse/PDFBOX-2117 > Project: PDFBox > Issue Type: Sub-task > Components: Rendering > Reporter: Petr Slaby > Attachments: 000001_MTEXT_CS6.pdf, AxialShading.patch, > AxialShading1.patch, AxialShadingContext.java.getrgbimage, > Shading2Function2.pdf, Shading2Function2.ps, Shading2Function2text.pdf, > asy-shade.pdf, color_gradient.pdf, shading_pattern.pdf > > > AxialShadingContext#getRaster() is on top of profiler hot spots in documents > that use an axial shading. Inside it, the slowest part is calling > PDColorSpaceRGB#toRGB() and PDFunctionType3#eval() (in this order). > -- This message was sent by Atlassian JIRA (v6.2#6252)