This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-4d48f86c-424d-47e5-be6a-bc62588913b8 XWIKI-22577 Open

Cloning documents with many XObjects and high object numbers is slow

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-4f6f40d1-6ec3-4e4d-a670-b438b73c0b9c Michael Hamann created this issue on 15/Oct/24 15:49
 
Summary: Cloning documents with many XObjects and high object numbers is slow
Issue Type: cid:jira-generated-image-avatar-4d48f86c-424d-47e5-be6a-bc62588913b8 Bug
Affects Versions: 14.0-rc-1
Assignee: Unassigned
Attachments: clipboard.png
Components: Old Core
Created: 15/Oct/24 15:49
Labels: performance
Priority: cid:jira-generated-image-static-major-9b95d850-1aa7-49ac-9681-f339fb748884 Major
Reporter: Michael Hamann
Description:

Steps to reproduce:

Clone a document with high object ids and possibly also many XObjects, for example object numbers above 100000 many times (e.g., 50 times). This can, e.g., be seen when viewing an extension document on xwiki.org when the content and the effective metadata author are different and the extension has large object ids.

Expected result:

Cloning a document is fast, as we do this all the time.

Actual result:

Cloning is slow. The main problem seems to be that it gets 100k times the list of XObjects for a certain XClass document reference from a ConcurrentSkipListMap which performs several comparisons of the document reference. The comparison of document references first serializes them to a string:

42852_clipboard.png

There seem several possible optimizations:

1. Add a cache of the toString serialization to document reference.
2. Avoid getting the XObject list for every object of the same time separately - we could get it once and then add all objects to it.