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

Speed up StringBuilder::append(char[]) via UTF16::compress & Unsafe::copyMemory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • None
    • core-libs
    • None

      In BufferedReader.readLine and other similar scenarios, we need to use StringBuilder.append(char[]) to build the string.

      For these scenarios, we can use the intrinsic method StringUTF16.compress and Unsafe.copyMemory instead of the character copy of the char-by-char loop to improve the speed.

            swen Shaojin Wen
            swen Shaojin Wen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: