Skip to content

Commit

Permalink
Use const array for unrolled Huffman table
Browse files Browse the repository at this point in the history
Motivation

We've spent a long time with an unrolled Huffman-table to optimize the
Huffman decoding of HPACK headers. This works well, but because of some
limitations in Swift it's been impossible to embed this structure in the
binary directly: we've always had to alloc-and-copy on startup.
Additionally, due to type checker performance limitations, we've been
Base64 decoding it on startup, which isn't great either.

The introduction of const allows us to embed the knowledge of the fact
that this structure is compile-time constant in to the binary, improving
performance.

Modifications

Revert to the old layout, constify, and remove anything that blocks
that.

Result

Hopefully better performance and less dirty memory.
  • Loading branch information
Lukasa committed Apr 25, 2022
1 parent 72bcaf6 commit 6f76284
Showing 1 changed file with 4,107 additions and 4,493 deletions.
Loading

0 comments on commit 6f76284

Please sign in to comment.