You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Alfred (Jira)" <ji...@apache.org> on 2020/06/09 09:51:00 UTC

[jira] [Commented] (PDFBOX-4869) Reading standard 14 fonts is slow

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

Alfred commented on PDFBOX-4869:
--------------------------------

Ran a test for parsing the Courier-Bold font repeatedly.

When refering FontBox + PDFBox as jar on the classpath:

  Using a plain input stream, extraction took 1879ms.
  Using buffered input stream, extraction took 328ms.
  Using a plain input stream again, extraction took 1889ms.


When using the Fontbox+ PDFBox classes from a folder, not from a jar, there's no difference:

  Using a plain input stream, extraction took 446ms.
  Using buffered input stream, extraction took 449ms.
  Using a plain input stream again, extraction took 443ms.

> Reading standard 14 fonts is slow
> ---------------------------------
>
>                 Key: PDFBOX-4869
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4869
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Parsing, Text extraction
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Alfred
>            Priority: Major
>   Original Estimate: 1m
>  Remaining Estimate: 1m
>
> I ham testing text extraction from PDF and profiling the execution.
> I found that the second biggest time consumer is the static code in Standard14Fonts that loads fonts from the pdf box jar.
> The culprit seems to be the direct use of the stream returned getResurceAsStream.
> That would be a ZipInputStream when using PDFBox as a jar.
> Using a buffered stream around it reduces the load time a lot.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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