(bf) Optimize StringCharBuffer.toString(int, int)

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • b25
    • generic
    • generic

        Currently the implementation creates a String instance of the entire CharBuffer before using substring to subset out the selected part.

        If the CharBuffer is large then materializing the String only to subset it is wasted effort. For current implementations of String, StringBuilder, StringBuffer (and the prior pre-692524 implementation as well) gettting the interesting part via CharSequence.subSequence() and then calling toString() provides better performance and memory usage.

              Assignee:
              Mike Duigou
              Reporter:
              Mike Duigou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: