Conversation
dancixx
force-pushed
the
perf-eof-read-no-realloc
branch
2 times, most recently
from
October 1, 2026 07:35
9048c62 to
d197a2d
Compare
seanmonstar
reviewed
Oct 1, 2026
| fn poll_read_from_io_inner( | ||
| &mut self, | ||
| cx: &mut Context<'_>, | ||
| grow: bool, |
Member
There was a problem hiding this comment.
I find boolean arguments to be rather confusing at the call site. A custom 2-variant enum is likely always clearer.
dancixx
force-pushed
the
perf-eof-read-no-realloc
branch
from
October 1, 2026 19:04
d197a2d to
13b783b
Compare
dancixx
force-pushed
the
perf-eof-read-no-realloc
branch
from
October 1, 2026 19:08
13b783b to
c2a7377
Compare
This branch has not been deployed
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.
The EOF check that runs while a request is in flight (
mid_message_detect_eof→force_io_read) reserves a full 8 KiB read chunk whenever the spare capacity is smaller, which it always is right after a head was split off. The head still shares the buffer, so every request allocates a new one when the service holds on to the request (axum does).This reads into the existing spare capacity instead and only grows a full buffer.
axum hello world: 14 → 12 allocations and 9,280 → 1,048 bytes per request. The added test fails without the change.