Skip to content
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

WIP: fix slow parsing of large messages #229

Merged
merged 3 commits into from
Sep 19, 2021
Merged

Conversation

porsager
Copy link
Owner

@porsager porsager commented Sep 9, 2021

Following the discussion in #207 I made this fix. I might improve the code a little before merging, but this introduces only performance improvements and no performance regressions.

@eugene1g
Copy link
Contributor

eugene1g commented Sep 9, 2021

The logic is philosophically the same as alt solutions in that PR 👍

@@ -33,6 +33,8 @@ function Connection(options = {}) {
let next = false
let statements = {}
let connect_timer
let bs = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe naming this as bufferStack or bufferQueue would help to understand what's going on 6 months later :D

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea 😉 But bs is such a nice variable name 🤪

@stalniy
Copy link
Contributor

stalniy commented Sep 9, 2021

have no idea how it works :D but it's awesome that it improves the performance for big chunks :)

Update: I've just read your comment in issue and it becomes more clear :) Thanks!

@porsager porsager merged commit 2c3353b into master Sep 19, 2021
@porsager porsager deleted the fix-slow-large-messages branch September 19, 2021 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants