RFR: 8345314: Add a red–black tree as a utility data structure [v7]
Johan Sjölen
jsjolen at openjdk.org
Thu Jan 9 13:54:40 UTC 2025
On Thu, 9 Jan 2025 13:02:31 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:
>> In fact, you can pre-size the GA such that it starts with a capacity of 2log(n+1)
>
> I thought the recursive versions looked neater, but changed them now to the iterative version with pre-sized GAs
I agree, they do look neater. The pre-sized GAs are also kinda costly, often you want to keep your allocated GA around for future calls (found this out the hard way), whilst stack allocations are just gonna be kept around and it's unlikely that we'll hit the stack ceiling but... Let's just be safe rather than sorry.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22360#discussion_r1908840922
More information about the hotspot-dev
mailing list