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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 9
    • 9
    • 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.

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

                Created:
                Updated:
                Resolved: