W3C home > Mailing lists > Public > ietf-http-wg@w3.org > January to March 2014

Things I like about HPACK

From: Adrian Cole <adrian.f.cole@gmail.com>
Date: Thu, 9 Jan 2014 16:45:24 -0800
Message-ID: <CAHzwyDsJbArW3GVwhTGp+4hUe3kTcr1ZjvngFAh7WyMMEQRLMA@mail.gmail.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
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.

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:23 UTC