On Fri, 15 Nov 2024 07:32:37 GMT, Axel Boldt-Christmas <abold...@openjdk.org> 
wrote:

> > I have been playing with 
> > [8343704-node-cache.txt](https://github.com/user-attachments/files/17753986/8343704-node-cache.txt)
> >  -- is that what you had in mind?
> 
> Yes. It amortises the allocation over at least NODE_CAPACITY inserts, instead 
> of 1 in the worst case.

Pushed that into PR. There is some measurable impact for dealing with this node 
cache during heavy churn, but it is still well within the improvements margin 
we get wholesale.

I am willing to accept this single-slot cache for three reasons: a) crossing 
the artificial border with just a single cleaner registering and unregistering 
looks like something we want to mitigate to avoid surprises; b) Cleaners are 
recommended by Javadoc to be shared, so wasting another node should not be as 
painful; c) the implementation and maintenance cost is not high.

But I would draw the line at this heuristics, and do nothing smarter :)

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

PR Comment: https://git.openjdk.org/jdk/pull/22043#issuecomment-2478457365

Reply via email to