You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2025/12/04 19:01:00 UTC

[jira] [Commented] (PDFBOX-4370) Jempbox's ResourceEvent crazily slow to initialize

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

Tilman Hausherr commented on PDFBOX-4370:
-----------------------------------------

After closing I realized I hadn't properly read the text, I had stopped reading at getHistory(). I don't know if the rest (about the initializer) applies or not, however I just did run a test with getHistory() and it was quite fast.

> Jempbox's ResourceEvent crazily slow to initialize
> --------------------------------------------------
>
>                 Key: PDFBOX-4370
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4370
>             Project: PDFBox
>          Issue Type: Task
>          Components: JempBox
>    Affects Versions: 1.8.16
>            Reporter: Tim Allison
>            Priority: Trivial
>         Attachments: slow.zip
>
>
> In our new batch of regression files on Tika, one of the new PDFs caused a timeout.  This is not an infinite loop, but it does take several minutes. This may not be fixable.
> Admittedly, the XMP is large, and there are quite a few events.
> This is the code that triggers the problem.
> {noformat}
>             XMPMetadata xmp = XMPMetadata.load(is);
>             XMPSchemaMediaManagement mmSchema = xmp.getMediaManagementSchema();
>             mmSchema.getHistory();
> {noformat}
> The slow part _seems_ to be setting the attribute namespace when creating a new ResourceEvent.  When I comment out the following in ResourceEvent's initializer, the processing time is quite fast (1 second).
> {noformat}
>             parent.setAttributeNS( 
>                 XMPSchema.NS_NAMESPACE, 
>                 "xmlns:stEvt", 
>                 NAMESPACE );
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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