Reduce Arrays.copyOf/-Range overheads

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: