Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8039124

j.u.regex.Matcher.appendReplace/Tail() should support StringBuilder variant for better performance

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b08
    • Verification:
      Verified

      Description

      The Matcher class has a few public methods that take StringBuffers,
      and we've found it useful to add similar versions that take StringBuilders.

      It has two benefits:

      - Users don't have to convert from one to the other when they want to use
      the method in question. The symmetry is nice.

      - The StringBuilder variants are faster (if lock optimizations don't kick
      in, which happens in the interpreter and the client compiler). For
      interpreted / client-compiled code, we saw something like a 25% speedup on
      String.replaceAll(), which calls into this code.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sherman Xueming Shen
              Reporter:
              sherman Xueming Shen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: