RFR: 8325679: Optimize ArrayList subList sort

Attila Szegedi attila at openjdk.org
Mon Feb 12 22:58:22 UTC 2024


Somewhat surprisingly, `ArrayList$Sublist.sort()` is not specialized and will thus fall back to slower default method of `List.sort()` instead of sorting a range of the array in-place in its backing root `ArrayList`. 

This doesn't change observable behavior, so haven't added tests, and `tier1` tests still all pass except for `test/jdk/java/util/Locale/LocaleProvidersFormat.java` which also currently fails on master too on the machine I tested on.

-------------

Commit messages:
 - Add sort specialization for ArrayList

Changes: https://git.openjdk.org/jdk/pull/17818/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17818&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8325679
  Stats: 14 lines in 1 file changed: 12 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/17818.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17818/head:pull/17818

PR: https://git.openjdk.org/jdk/pull/17818


More information about the core-libs-dev mailing list