Repository navigation
perf(http2): use static HPACK names for request headers - #37
Merged
Merged
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.
Standard user headers currently spell out their names in every reusable HTTP/2 request block. Use the RFC 7541 static-table name reference while retaining the caller's plain value, order, duplicates and literal-without-indexing semantics. Unknown names remain literal. A representative eight-header block becomes 151 bytes instead of 235, saving 84 bytes on every request without per-request encoder work.
Three alternating counted pairs against a fixed Node 20.20.2/nghttp2 1.61.0 decoding peer gain 32.91% median RPS. A separate reversed-order confirmation with twice as many requests gains 33.29%. All six pairs improve (29.61–37.86%); server CPU/request falls 24.84% in both series. Mean latency falls 24.73%/24.94% and p99 falls 26.79%/38.41%. This claim is specific to the eight-header decoding workload.
b8766f9; Rust 1.99.1, default production features, consistent fat LTO/one codegen unit, independently frozen--bin shbbuilds. WSL2/Ryzen 9 3950X, client CPU 8, server CPU 0; 16 connections × 64 streams. 32,768 warmups/variant, then 131,072 requests/sample (confirmation 262,144).CI now runs the independent oracle with pinned versions. Reproducible counted peer/driver, complete methodology, workload JSON, limitations and all guard results are in
benchmarks/h2-static-header-names.md. Raw measurements remain in localshb/optimization-results/c178/; no large artifacts are committed. HTTP/1 and HTTP/3 encoders are unchanged; this does not resolve historical QUIC loss-recovery limitations.