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

proto/h1/server: avoid copy-allocation in request path parsing #3575

Merged
merged 2 commits into from Feb 21, 2024

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Feb 20, 2024

This tweaks the request path parsing logic (in server role) in order to perform zero-copy URI parsing.

Closes: #3574

@lucab lucab marked this pull request as draft February 20, 2024 09:07
@lucab lucab force-pushed the ups/uri-parse-zerocopy branch 3 times, most recently from 627dac7 to 977d42e Compare February 20, 2024 09:46
@lucab lucab marked this pull request as ready for review February 20, 2024 10:13
This tweaks the request path parsing logic (in server role) in order
to perform zero-copy URI parsing.
@seanmonstar seanmonstar merged commit 724bde7 into hyperium:master Feb 21, 2024
21 checks passed
let bytes_ptr = bytes.as_ptr() as usize;
let start = req_path.as_ptr() as usize - bytes_ptr;
let end = start + req_path.len();
std::ops::Range { start, end }
Copy link
Contributor

Choose a reason for hiding this comment

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

This can just be start..end fyi

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.

proto/h1: spurious copy-allocation in request parsing hotpath
3 participants