Skip to content

perf: batch HPACK encoder writes per u32 - #938

Merged
seanmonstar merged 1 commit into
masterfrom
sean/lopkmsvnttxu
Aug 25, 2026
Merged

perf: batch HPACK encoder writes per u32#938
seanmonstar merged 1 commit into
masterfrom
sean/lopkmsvnttxu

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

This accumulates HPACK encoding into a u32, and then writes to the buffer with put_u32, instead of put_u8 for each byte. Seems to improve HPACK encoding performance a nice amount:

Input Before After Improvement
www.example.com 94.67 ns 58.07 ns 39% faster
Typical header value 401.02 ns 169.01 ns 58% faster
Long ASCII value 564.40 ns 272.63 ns 52% faster
All 256 octets 4.603 µs 1.649 µs 64% faster

@seanmonstar
seanmonstar force-pushed the sean/lopkmsvnttxu branch 2 times, most recently from 59d985a to bff8768 Compare August 24, 2026 21:28
@seanmonstar
seanmonstar merged commit 69a678a into master Aug 25, 2026
6 checks passed
@seanmonstar
seanmonstar deleted the sean/lopkmsvnttxu branch August 25, 2026 17:57
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