Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-790

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

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    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.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: