Things I like about HPACK

I've been implementing HPACK for okhttp (java/android client).
Eventhough the work isn't complete (compression strategy, huffman), I
thought I could share some nice thoughts.

I found that implementing this protocol, while not trivial, can be
done very efficiently.  Particularly as the static table is <64
entries, I was able to use a 64bit number as a bitset to determine
which are referenced.  Specifying additions as the front of the table
and evictions from the end makes it possible to implement the table
with a simple array, reasonably neatly.  Evicting all on overflow also
simplifies the code.

I'm not terribly thrilled about huffman being bundled in, (and hope
other extra algorithms aren't required in the future).  This feels
like unnecessary complexity, despite it saving some bytes.  That said,
there don't need to be many implementations of HPACK, so no big deal.

All in, HPACK draft 5 has been quite enjoyable to develop.  Thanks for
the good work.

Cheers,
-A

Received on Friday, 10 January 2014 00:45:51 UTC