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

Reduce Arrays.copyOf/-Range overheads

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • core-libs
    • None
    • b10

      We liberally use Arrays.copyOfRange in String constructors etc, but while investigating another performance issue (JDK-8295496) it was made apparent that the redundant range check and length clamping done by this method has a measurable cost.

      Specializing for cases where from is zero and to might be length helps String constructors by a sizable amount, reducing checks but also enabling improved matching of arraycopy stubs.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: