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 "Joerg Hoh (Jira)" <ji...@apache.org> on 2025/06/30 12:04:00 UTC
[jira] [Created] (OAK-11780) Overhead in JCR XML import
Joerg Hoh created OAK-11780:
-------------------------------
Summary: 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.80.0, 1.78.0
Reporter: Joerg Hoh
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)