Skip to content

Index the QPACK static table by name - #10

Merged
glbrntt merged 5 commits into
apple:mainfrom
glbrntt:static-table-find
Jul 16, 2026
Merged

Index the QPACK static table by name#10
glbrntt merged 5 commits into
apple:mainfrom
glbrntt:static-table-find

Conversation

@glbrntt

@glbrntt glbrntt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Motivation:

StaticHeaderTable.find does a linear scan of all 99 static table
entries. It's called once per header by both the static and dynamic
encoders. The scan relies on string comparisons for (potentially) every
header name in the table which is where a lot of the cost lies.

Modifications:

  • Add a static field name to index map. This is used by find to get
    all indexes for a given header in constant time.
  • Add benchmarks

Result:

Faster header encoding

  • static encoding benchmark: 2.8x faster
  • dynamic encoding benchmark: 1.3x faster

glbrntt added 2 commits July 8, 2026 15:45
Motivation:

StaticHeaderTable.find does a linear scan of all 99 static table
entries. It's called once per header by both the static and dynamic
encoders. The scan relies on string comparisons for (potentially) every
header name in the table which is where a lot of the cost lies.

Modifications:

- Add a static field name to index map. This is used by `find` to get
  all indexes for a given header in constant time.
- Add benchmarks

Result:

Faster header encoding

- static encoding benchmark: 2.8x faster
- dynamic encoding benchmark: 1.3x faster
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jul 8, 2026
@glbrntt
glbrntt requested a review from josephnoir July 8, 2026 14:50
@glbrntt

glbrntt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Note that this PR is split across two commits:

Comment thread Sources/QPACK/Headers/StaticHeaderTable.swift Outdated
@glbrntt
glbrntt enabled auto-merge (squash) July 10, 2026 07:26
@glbrntt
glbrntt merged commit 240d833 into apple:main Jul 16, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants