RFR: 8266431: Dual-Pivot Quicksort improvements (Radix sort) [v2]

Vladimir Yaroslavskiy duke at openjdk.org
Wed Oct 22 20:31:44 UTC 2025


On Sat, 11 Oct 2025 08:39:39 GMT, Tagir F. Valeev <tvaleev at openjdk.org> wrote:

>> Vladimir Yaroslavskiy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   JDK-8266431: Dual-Pivot Quicksort improvements
>>   
>>   * Moved Radix sort out from sorting
>
> src/java.base/share/classes/java/util/DualPivotQuicksort.java line 66:
> 
>> 64:      * Max size of array to use insertion sort.
>> 65:      */
>> 66:     private static final int MAX_INSERTION_SORT_SIZE = 51;
> 
> Was this change justified by benchmarking? Why was the best value different before? Due to hardware changes or due to HotSpot/JIT changes or due to algorithmic changes below?

These changes are  due to algorithmic changes - more optimized insertion sort (combination of mixed, pin and simple insertion sortings), therefore we can run insertion sort on larger arrays.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27411#discussion_r2453278837


More information about the core-libs-dev mailing list