[
https://issues.apache.org/jira/browse/PDFBOX-2871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14624295#comment-14624295
]
John Hewson edited comment on PDFBOX-2871 at 7/13/15 7:08 AM:
--------------------------------------------------------------
We have to load each font file and read data from it in order to build an index
of fonts on the system and their various properties. On my system PDFBox loads
~500 fonts in ~4sec, which is 125ms per font. That could certainly be faster,
but our font parsers, while fast enough, weren't written for this sort of high
performance.
The new cache is persistent across runs, if you log at INFO level then PDFBox
will tell you when it re-builds the cache. If you're using the snapshot, make
sure you have the latest version, if you're using SVN make sure you update and
rebuild, etc.
was (Author: jahewson):
We have to load each font file and read data from it in order to build an index
of fonts on the system and their various properties. On my system PDFBox loads
~500 fonts in ~4sec, which is 125ms per font. That could certainly be faster,
but our font parsers, while fast enough, weren't written for this sort of high
performance.
The new cache is persistent across runs, if you log at INFO level then PDFBox
will tell you when it re-builds the cache.
> Performance issue when filling the first PDTextField of an AcroForm
> -------------------------------------------------------------------
>
> Key: PDFBOX-2871
> URL: https://issues.apache.org/jira/browse/PDFBOX-2871
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Affects Versions: 2.0.0
> Reporter: Maruan Sahyoun
> Assignee: John Hewson
> Priority: Critical
> Labels: Appearance
> Fix For: 2.0.0
>
> Attachments: PDTextField.pdf, ProfilingOutput.png
>
>
> When filling the first PDTextField in a form the performance is slow. All
> other PDTextFields in the form are handled quickly.
> This code
> {code}
> PDTextField field = (PDTextField)
> doc.getDocumentCatalog().getAcroForm().getField("Textfield01");
> long start = System.nanoTime();
> field.setValue("ABCD");
> long end = System.nanoTime();
> double difference = (end - start)/1e6;
> System.out.println(difference);
> field = (PDTextField)
> doc.getDocumentCatalog().getAcroForm().getField("Textfield02");
> start = System.nanoTime();
> field.setValue("ABCD");
> end = System.nanoTime();
> difference = (end - start)/1e6;
> System.out.println(difference);
> {code}
> produces the following output
> {noformat}
> 9713.38
> 3.904
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]