-
Notifications
You must be signed in to change notification settings - Fork 719
Just store NIOAny in the pending array. #275
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
Conversation
Motivation: We stored a closure in the pending array which is not really needed. We can just store the NIOAny directly without creating a closure first. Modifications: Replace closure with NIOAny Result: Less creation of closures.
|
noticed this while working on http perf stuff. |
Lukasa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, seems reasonable enough to me. I think we expected this to have more functions that needed to be called then we actually ended up getting.
weissi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
@normanmaurer would you mind seeing what this does to the number of allocations we do? Just run and paste those lines that appear close to the end of (a lot of) output: the test will also take quite a while to run... I'd expect this to go down quite a bit. Need to run it before/after your patch obvs. |
|
Before: With this pr: |
|
@normanmaurer awesome 👏. That removes 10 allocations per request! |
Motivation:
We stored a closure in the pending array which is not really needed. We can just store the NIOAny directly without creating a closure first.
Modifications:
Replace closure with NIOAny
Result:
Less creation of closures.