This issue has been created
There are 5 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-31c35687-bfeb-457d-b127-311e2fe0c609 XWIKI-24328 Closed

The anchor refactoring performed by PDF export is very inneficient

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3742cea9-dcf4-4e01-9cca-807d97645541 Marius Dumitru Florea created this issue on 07/May/26 16:30
 
Summary: The anchor refactoring performed by PDF export is very inneficient
Issue Type: cid:jira-generated-image-avatar-31c35687-bfeb-457d-b127-311e2fe0c609 Improvement
Affects Versions: 17.10.8, 18.3.0
Assignee: Unassigned
Components: Export - PDF
Created: 07/May/26 16:30
Priority: cid:jira-generated-image-static-major-c2462a9f-6e6e-4b01-a0f7-4083e7f79b28 Major
Reporter: Marius Dumitru Florea
Description:

In order to debug a timeout of a very large PDF export (3k print pages) I added some logs to see the time spend by PDF export on each step, client side. This showed that a significant amount of time was spent refactoring the anchors (links) before generating the print layout:

PageReady: 46263.615966796875 ms
protectAgainstMissingStyleSheets: 2.33203125 ms
refactorAnchors: 146766.5751953125 ms <------------ 2m30s 
removeEmptyTableOfContents: 0.8701171875 ms
validateTableOfContentsAnchors: 322.55517578125 ms
storeFormFieldValues: 170.8349609375 ms
makeTableCellWidthRelative: 295.844970703125 ms
preserveWhiteSpaceInCodeBlocks: 255.382080078125 ms
preventLazyImageLoading: 12.23095703125 ms
replaceCanvasesWithImages: 11.02587890625 ms
PrintLayout: 3058505.505859375 ms
PrintPreview: 3253575.2138671875 ms (54 min)

This made me check the code. It is indeed quite inefficient. For such a large PDF export you have thousands of anchors (links) so it's important to process them in an optimal way.

 
 

5 updates

 
cid:jira-generated-image-avatar-3742cea9-dcf4-4e01-9cca-807d97645541 Changes by Marius Dumitru Florea on 07/May/26 16:31
 
Fix Version: 18.4.0-rc-1
Fix Version: 17.10.9
Assignee: Marius Dumitru Florea
Resolution: Fixed
Status: Open Closed