pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkühler (JIRA) <j...@apache.org>
Subject [jira] [Resolved] (PDFBOX-1159) Speed up LZWFilter decoding
Date Fri, 18 May 2012 10:56:07 GMT

     [ https://issues.apache.org/jira/browse/PDFBOX-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Andreas Lehmkühler resolved PDFBOX-1159.

       Resolution: Fixed
    Fix Version/s: 1.7.0
         Assignee: Andreas Lehmkühler

I applied the patch in revision 1340063 as proposed except the changes to the Encoding class
which has nothing to do with the LZW filter. I guess it was added by accident, wasn't it?

Thanks for the contribution!
> Speed up LZWFilter decoding
> ---------------------------
>                 Key: PDFBOX-1159
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1159
>             Project: PDFBox
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>             Fix For: 1.7.0
>         Attachments: PDFBOX-1159.patch
> I noticed that the LZW decoder performance can be improved: it's
> allocating a new byte[] for every byte it visits in the stream.  This
> is actually an O(N^2) cost, but N is typically fairly small.
> I changed LZWDictionary to use its own private growable byte[] to
> accumulate each added byte.  I also changed it to not pre-enroll all
> initial (0-255) codes, but instead add it (lazily) on demand if the
> code is used.
> I also randomized the TestFilters test, and mixed in some
> "more predictable" patterns, so we get better testing of the filters.
> If the test fails it prints the seed used for the random numbers, so
> we can reproduce the failure.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message