Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-648

Provide API to double a char in a string

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 6.2
    • 6.2-rc-1
    • Text
    • Unit

    Description

      Yes there is someString.replace("a", "aa"); but I want something as fast as possible for a very repetitive task in this case (11000 calls that takes 12% of the time when viewing an empty page in XE).

      Here the result of some benchmarks I did before creating doing it:

      • about 3 times quicker when there is something to do (whatever you do around it most of the time is taken by StringBuilder operations in practice but 3 is already nice)
      • about 30 times quicker when there is nothing to do (which is about 99% of the time in our case)

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: