There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-5b298f70-07b8-426f-b775-aa88593d9751 XWIKI-22577 Open

Cloning documents with many XObjects and high object numbers is slow

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-2424cc44-8235-4e4d-82f7-b711456cf59a Changes by Michael Hamann on 16/Oct/24 09:31
 
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:

!clipboard.png!

There seem several possible optimizations:

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