-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure ChannelHandlerContext.isRemoved
is called only when in event loop
#3031
Conversation
How do you feel about reducing the code duplications between the
then do a variant like this (I have verified by doing a benchmark and the performance is similar):
or the above could be considered in another enhancement PR ? |
I was thinking about this, but isn't this generating too many unnecessary objects in a hot path? |
I just verified with a comparison benchmark, it's really similar, it even goes a bit faster, and lambda/invokedynamic do not allocate objects if I'm correct. |
Yes. to be clear, here is a similar thing, but with lambdas enclosed in braces:
is there any concerns about the above or about the initial proposal ? |
mmm, my bad, this morning, I was reviewing the previous comments, and the lambdas are, as you mentioned, accessing instance fields of the surrounding class, and if correct, this requires capturing the value of the this reference. Please forget about the proposed enhancement! 😊 |
@pderop Thanks for the review! |
Related to #2981