RFR: 8360023: Add an insertion sort implementation to Hotspot [v3]
Evgeny Astigeevich
eastigeevich at openjdk.org
Thu Jun 19 15:30:27 UTC 2025
On Thu, 19 Jun 2025 15:07:44 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
> ...save us the troubles generalizing the specialized function if the need arises.
Unfortunately experience teaches us, code written for purpose of future uses is never used as is.
These many years of the project, there have not been any needs for a stable sort. Your case is the first one. You cannot predict other cases.
If you want the insertion sort, I'd recommend to have it in `GrowableArrayView`: `GrowableArrayView<>::insertion_sort()`.
In this case you will not have the issue with iterators names which is a big issue from my point of view.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25895#issuecomment-2988492649
More information about the hotspot-dev
mailing list