Fix large message read performance by enforcing max read_buffer_size read chunks#496
Merged
daniel-abramov merged 3 commits intosnapview:masterfrom May 23, 2025
Merged
Conversation
b9f2acc to
58f6d5a
Compare
Co-authored-by: Daniel Abramov <inetcrack2@gmail.com>
Contributor
Author
|
With the proposed e2e benchmarks in #497 we also see the performance addressed there: You have to love that criterion performance improvement detection logic 😅
|
|
Basically, it should dramatically close the performance gap with fastwebsockets, which is good |
Contributor
Author
|
critcmp using #497 e2e benches |
|
That's crazy! well done Alex |
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.
Non-breaking change to use
read_buffer_sizeas a maximum read buffer size, so a large message will be read in chunks of, by default, 128KiB. This seems to significantly improve the performance of large messages.See #493 (comment)
Resolves #493
Benchmarks
Using the #493 provided benches this fix addresses the regression and indeed provides better performance for all sizes than 0.24.
I think we should add some high quality benches into this repo so we can track general performance better with a real
Readimpl. The current read benches are quite specific to batched small writes/reads. If I get time I'd like to add some as a follow up.