Commit 21612ca
committed
perf: optimize HPACK and QPACK header compression for O(1) lookups
Replace O(n) list-based dynamic table lookups with O(1) map-based
implementation for HTTP/2 HPACK. Optimize HTTP/3 QPACK static table
with map-based lookups.
Key changes:
- Add hackney_hpack.erl with ring buffer + maps for dynamic table
- Add hackney_hpack_huffman.hrl with pre-computed Huffman codes
- Optimize hackney_qpack.erl static table from list to maps
- Update hackney_cow_http2_machine.erl to use new hackney_hpack
Performance improvements:
- Dynamic table lookups: 3-6x faster as table fills
- QPACK static lookups: O(1) via maps vs O(n) list iteration
- Maintains RFC 7541 (HPACK) and RFC 9204 (QPACK) compliance1 parent 2a1d2cc commit 21612ca
6 files changed
Lines changed: 1834 additions & 212 deletions
0 commit comments