You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2025/06/30 15:04:00 UTC

[jira] [Commented] (OAK-11780) Overhead in JCR XML import

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

Julian Reschke commented on OAK-11780:
--------------------------------------

This may become problematic:
{code:xml}
<a:foo xmlns:a="uri1">
  <a:qux xmlns:a="uri2"/>
  <a:bar/>
</a:foo>
{code}

> Overhead in JCR XML import
> --------------------------
>
>                 Key: OAK-11780
>                 URL: https://issues.apache.org/jira/browse/OAK-11780
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: jcr
>    Affects Versions: 1.78.0, 1.80.0
>            Reporter: Joerg Hoh
>            Priority: Major
>
> I was tracing an import of a long-running installation of a filevault package and found that {{TargetImportHandler.createCurrentPrefixMap}} is invoked whenever {{startPrefixMapping}} or {{endPrefixMapping}} is invoked.
> Now I have in the [ImportHandler.startElement|https://github.com/apache/jackrabbit-oak/blob/298ee403db0e1aa40368681e98ee17327bacdb1b/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/xml/ImportHandler.java#L174-L176] TargetImportHandler.startPrefixMapping is invoked in a loop, but next to adding the prefix also the {{currentPrefixMapping}} is calculated; which is not required, as it is only used in {{TargetImportHandler.currentNamePathMapper()}}, which is not called as part of this loop.
> For that reason the call to {{createCurrentPrefixMap}} should be moved into the {{TargetImportHandler.currentNamePathMapper()}} and only executed when it is actually needed.
> In my tests this shows up in about 12% of the stacktraces I created during the package import.



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