Make ActionListener.notifyOnce a little cheaper#97361
Make ActionListener.notifyOnce a little cheaper#97361original-brownbear merged 4 commits intoelastic:mainfrom original-brownbear:cleanup-notify-once
Conversation
This is used on the rather hot path now due to #97301, lets apply the optimization of saving one level of indirection here as well to make GC etc. a little cheaper on these.
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
DaveCTurner
left a comment
There was a problem hiding this comment.
Hm subclassing AtomicReference feels like a bit of a hack to me, I'd kinda prefer us to use a VarHandle directly. If you have strong reasons not to do so, they deserve a comment.
|
@DaveCTurner it's just less code and we have the thing package private here now anyway, so why blow up the code size when we won't be leaking that implementation detail? (we did the same thing elsewhere for private classes like |
|
Yeah I have the same feeling about I'd rather be explicit even if it is a few more lines of code - these things are a little subtle already. |
DaveCTurner
left a comment
There was a problem hiding this comment.
LGTM (for some value of "G" at least 😉)
|
Thanks David :) |
This is used on the rather hot path now due to #97301, lets apply the optimization of saving one level of indirection here as well to make GC etc. a little cheaper on these.