[
https://issues.apache.org/jira/browse/PDFBOX-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15373147#comment-15373147
]
Tilman Hausherr commented on PDFBOX-3418:
-----------------------------------------
Good find. I remember an earlier issue advising not to use percent formatting
(PDFBOX-2945).
> Slow string to hex conversion in ToUnicodeWriter
> ------------------------------------------------
>
> Key: PDFBOX-3418
> URL: https://issues.apache.org/jira/browse/PDFBOX-3418
> Project: PDFBox
> Issue Type: Improvement
> Components: PDModel
> Affects Versions: 2.0.2
> Environment: Ubuntu 14.04 LTS
> Reporter: Michael Doswald
> Priority: Trivial
> Labels: optimization, performance
> Attachments: PDFBOX-3418_PerformanceTest.zip,
> PDFBOX-3418_ToUnicodeWriter_performance_rev1.patch
>
>
> The ToUnicodeWriter.writeTo(OutputStream) method converts a lot of shorts and
> strings to hexadecimal strings. This is done with String.format and therefore
> not very efficient.
> The ToUnicodeWriter.toHex(int) and ToUnitcodeWriter.stringToHex(String)
> methods could be rewritten to generate a char-array and being generally more
> efficient.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]