Uploaded image for project: 'cTAKES'
  1. cTAKES
  2. CTAKES-531

String.replaceAll() has bad performance against replace() if not regex.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      Location: 

      (1) ctakes-core/src/main/java/org/apache/ctakes/core/cc/html/HtmlTextWriter.java

      (2) ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/util/FileUtil.java

       

      The String.replaceAll(regex, other) can replace the string satisfying the "regex" with the given "other" string. However, if the given "regex" is a simple plain string (i.e., no special characters), another API String.replace(origin, other) is recommended as the former need to be compiled a head of time, which will cause additional overhead.

        Attachments

        1. 1.patch
          2 kB
          bd2019us

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bd2019us bd2019us
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: