You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Roberto Nibali (JIRA)" <ji...@apache.org> on 2015/07/13 07:26:05 UTC

[jira] [Comment Edited] (PDFBOX-2871) Performance issue when filling the first PDTextField of an AcroForm

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

Roberto Nibali edited comment on PDFBOX-2871 at 7/13/15 5:26 AM:
-----------------------------------------------------------------

I'm not sure why I understand why it should take 10 seconds to scan all fonts on a filesystem, without networked fonts:

$ time find ~/Library/Fonts /Network/Library/Fonts /System/Library/Fonts /Library/Fonts -type f -name "*.otf" -o -name "*.ttf" -o -name "*.pfb" -o -name "*.ttc"
real	0m0.014s
user	0m0.005s
sys	0m0.006s

What exactly is taking 10 seconds on my system? While I appreciate the font directory entry cache put in place, for testing code, it's quite a nuisance at the moment, since the cache needs to be built every time I invoke the new code to test. The cache probably only kicks in once I'm finished with my implementation and have it run against multiple input PDFs.

I'm sure this can be fixed.


was (Author: rnibali):
I'm not sure why I understand why it should take 10 seconds to scan all fonts on a filesystem, without networked fonts:

$ time find ~/Library/Fonts /Network/Library/Fonts /System/Library/Fonts /Library/Fonts -type f -name "*.otf" -o -name "*.ttf" -o -name "*.pfb" -o -name "*.ttc"
real	0m0.014s
user	0m0.005s
sys	0m0.006s

What exactly is taking 10 seconds on my system?

> 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: Maruan Sahyoun
>            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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org