Skip to content

Intern known request header names to static AsciiString#2206

Merged
hyperxpro merged 1 commit into
mainfrom
header-name-interning
Jun 20, 2026
Merged

Intern known request header names to static AsciiString#2206
hyperxpro merged 1 commit into
mainfrom
header-name-interning

Conversation

@hyperxpro

Copy link
Copy Markdown
Member

Motivation:

When building the Netty request, well-known header names were passed as plain Strings, so Netty re-hashed and re-encoded them on every request instead of reusing cached AsciiString constants.

Modification:

Intern recognised header names to static AsciiString constants, applied only on a byte-identical lowercase match so the bytes put on the wire are unchanged.

Result:

Faster header encoding on the request path (it hits Netty's bulk-copy branch), with on-wire output unchanged.

@hyperxpro hyperxpro merged commit 02aa247 into main Jun 20, 2026
29 of 30 checks passed
@hyperxpro hyperxpro deleted the header-name-interning branch June 20, 2026 23:56
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.

1 participant