perf(http): parse buffered headers without whole-line strings - #604
Open
mizchi wants to merge 1 commit into
Open
perf(http): parse buffered headers without whole-line strings#604mizchi wants to merge 1 commit into
mizchi wants to merge 1 commit into
Conversation
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.
Header lines already present in the transport buffer currently go through async
read_untiland a whole-line UTF-8 String before the field name and value are copied out. This adds per-header work even when no I/O is needed.This change adds an internal
ReaderBuffer::take_buffered_untilhelper and a synchronous ASCII header parser. Buffered ASCII lines decode only the name and value; incomplete lines and non-ASCII text retain the existing paths. The borrowed view is consumed before the next read can mutate its buffer. Request-line parsing, cookies, duplicate-header rules, and body framing remain unchanged.I collected these measurements while benchmarking Mars, my web server implementation. See this report for the methodology, tradeoffs, reproduction commands, harness, and raw data.
Measurements use independent native release builds based on upstream
43e41261f99261f4030efbed1970388930229baa, five timing/three allocation rounds and three network rounds. These are short runs on a shared developer machine, not a production throughput claim. This PR is independent of #603.Validation on macOS:
moon check --deny-warnpasses for native, JS, Wasm, and Wasm-GC; formatting and generated interfaces updated.