RFR: 8360023: Add an insertion sort implementation to Hotspot [v2]

Quan Anh Mai qamai at openjdk.org
Thu Jun 19 14:07:50 UTC 2025


On Thu, 19 Jun 2025 13:45:37 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix windows build failures
>
>> The motivation for this is [JDK-8357186](https://bugs.openjdk.org/browse/JDK-8357186) in which a stable sort is desired and the number of elements is small.
> 
> Maybe instead of introducing a generalized version of the insertion sort, you can have a function implementing the insertion sort in the context of JDK-8357186? This specialized function will be much smaller than the PR changes.

@eastig Thanks a lot for your reviews. Yes a specialized insertion function could work, but a generalized function would be more useful and easier to test. A large part of this change is to modernize `GrowableArrayIterator`, and the actual insertion sort is pretty small (only about 40 LOC).

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

PR Comment: https://git.openjdk.org/jdk/pull/25895#issuecomment-2988227557


More information about the hotspot-dev mailing list