perf: avoid closure in BasicDeliver#81
Merged
Merged
Conversation
Contributor
Author
|
Hi @cody-greene, did you have a chance to look at the PR? |
Owner
|
Try passing "handler" directly to setImmediate
…-------- Original Message --------
On 8/12/25 2:39 AM, Ievgen Makukh wrote:
Samuron left a comment [(cody-greene/node-rabbitmq-client#81)](#81 (comment))
Hi ***@***.***(https://github.com/cody-greene), did you have a chance to look at the PR?
—
Reply to this email directly, [view it on GitHub](#81 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABQGASZG65WKXOVRFWJ3F5T3NGY4FAVCNFSM6AAAAACDBF7IW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNZYGU3DMMRYGI).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Contributor
Author
|
@cody-greene done, please check if I understood you correctly. I've also run a couple of tests and the number of GC pauses stays the same, but all the timings are now different on my machine for whatever reason. I can rerun all the tests if needed, but seems that this version should behave the same in terms of allocations and event better in terms of number of function calls |
Owner
|
Much cleaner. Looks good. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should cut an allocation for each consumed message. The testing idea is the same:
The script
Old results
New results
Conclusion
The GC count went down for 128 Mb case, but it went up for 2048 case a little bit. But the time for 2048 case is lower and number of times has some fluctuations anyway, so I think it still a net win.