This issue has been created
There is 1 update.
 
 
XWiki Rendering / cid:jira-generated-image-avatar-cea08a5e-7a38-4235-b85c-fa56b774a30c XRENDERING-790 Open

The plain text parser shouldn't use regular expressions to detect special characters

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-33f4c0dd-bb6f-41c8-bff5-0564c324d84a Michael Hamann created this issue on 04/Jun/25 17:52
 
Summary: The plain text parser shouldn't use regular expressions to detect special characters
Issue Type: cid:jira-generated-image-avatar-cea08a5e-7a38-4235-b85c-fa56b774a30c Bug
Affects Versions: 16.10.0
Assignee: Unassigned
Components: Syntax - plain/1.0
Created: 04/Jun/25 17:52
Labels: performance
Priority: cid:jira-generated-image-static-major-c6503ead-ed4a-445f-aa20-d4af2e0f532d Major
Reporter: Michael Hamann
Description:

The plain text parser uses a regular expression to detect if a character is in a list of characters. This regular expression is used for every single character. When profiling this with the block parser (so creating an XDOM), this regular expression dominated the running time of the plain text parser - 190ms out of 260ms total running time for the "parse" method. While the plain text parser is still very fast, there is absolutely no reason for this relatively slow regular expression, a simple BitSet with the characters to match would be both simpler to use and faster.

 
 

1 update

 
cid:jira-generated-image-avatar-33f4c0dd-bb6f-41c8-bff5-0564c324d84a Changes by Michael Hamann on 04/Jun/25 17:52
 
Assignee: Michael Hamann