(str) optimize StringBuilder.append(CharSequence, start, end)

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • tbd
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      If you have a StringBuilder sb and a String str, then the following method runs very quickly:

          sb.append(str)

      because this method is an intrinsic. However, if you want to append only a subrange of the source string,

          sb.append(str, start, end)

      is much slower, because it does some range checking and then runs a Java loop from AbstractStringBuilder to do the copying.

      It might be a useful optimization to optimize this code path, possibly by providing an intrinsic for StringBuilder.append(String, start, end).

            Assignee:
            Unassigned
            Reporter:
            Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: