Compression ratio of 09 (was: Reference set in HPACK)

Kazu Yamamoto ( 山本和彦 ) <kazu@iij.ad.jp> Wed, 06 August 2014 02:34 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 88CA61B2A68 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 5 Aug 2014 19:34:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.403
X-Spam-Level:
X-Spam-Status: No, score=-2.403 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, CHARSET_FARAWAY_HEADER=3.2, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cHAs1Uuq4nlv for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 5 Aug 2014 19:34:33 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 79E7A1B28B3 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 5 Aug 2014 19:34:33 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1XEr0M-0004rd-Tc for ietf-http-wg-dist@listhub.w3.org; Wed, 06 Aug 2014 02:31:06 +0000
Resent-Date: Wed, 06 Aug 2014 02:31:06 +0000
Resent-Message-Id: <E1XEr0M-0004rd-Tc@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <kazu@iij.ad.jp>) id 1XEr02-0004qq-Jr for ietf-http-wg@listhub.w3.org; Wed, 06 Aug 2014 02:30:46 +0000
Received: from mo00.iij.ad.jp ([202.232.30.145] helo=omgo.iij.ad.jp) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <kazu@iij.ad.jp>) id 1XEqzk-0007jd-26 for ietf-http-wg@w3.org; Wed, 06 Aug 2014 02:30:45 +0000
DKIM-Signature: v=1;a=rsa-sha256;c=relaxed/simple;d=iij.ad.jp;h=Date: Message-Id:To:Subject:From:In-Reply-To:References:Mime-Version:Content-Type: Content-Transfer-Encoding; i=kazu@iij.ad.jp; s=omgo2; t=1407292204; x=1408501804; bh=tiFRZ+e2hgblantXONrQ85/rR3HP/f/k53QBr1WF9Z4=; b=BYbDBouIYdw9PMgeRhSH445u5uP bXwOJ4g3nUBoBFSPq7o8Sd7p2ibLM3rlVReS6Xqt9B6PWFyF28MyY0lCWxYAF5RgqI4EOMQpTmnVf 5y1p2JwQQ3juMeuePwoOtrXWXg9h/M7Y+SEEeL8Miz5bXj0SeVg6Lm3zpffswFEVIc/i5disHDTlU tWPvjw/f8Yz+wXT2EtsFum1/VqPzLHCz0+QesnrD4+sfYBP1Be5LMLAz+IKYhIJ/Ov3XvPJAiKbCn aapIrwKT4FLevaW9JDiwX4deu/Ru05T9YcEQitoTMrygKW9M9BnZL3fZ/08UnjEM8alAKzxBG2l/l oaV1+5g==;
Received: by omgo.iij.ad.jp (mo00) id s762U4uq022464; Wed, 6 Aug 2014 11:30:04 +0900
X-MXL-Hash: 53e1932c3cbf03a9-e8f717db9cc36a0ebcff36ef3ada853389ee293a
Date: Wed, 06 Aug 2014 11:30:01 +0900
Message-Id: <20140806.113001.1439474552717547136.kazu@iij.ad.jp>
To: ietf-http-wg@w3.org
From: Kazu Yamamoto <kazu@iij.ad.jp>
In-Reply-To: <20140702.143041.283993814131065692.kazu@iij.ad.jp>
References: <20140702.143041.283993814131065692.kazu@iij.ad.jp>
X-Mailer: Mew version 6.6 on Emacs 24.3.92 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=202.232.30.145; envelope-from=kazu@iij.ad.jp; helo=omgo.iij.ad.jp
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: AWL=-3.115, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.668, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1XEqzk-0007jd-26 165ed842b16e0db718a1de195077066c
X-Original-To: ietf-http-wg@w3.org
Subject: Compression ratio of 09 (was: Reference set in HPACK)
Archived-At: <http://www.w3.org/mid/20140806.113001.1439474552717547136.kazu@iij.ad.jp>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/26525
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi,

I have implemented HPACK 09 and re-calculated compression ratio:

            08    09
Naive     1.10  1.10
Naive-H   0.86  0.85
Static    0.84  0.83
Static-H  0.66  0.66
Linear    0.39  0.39
Linear-H  0.31  0.31
Diff      0.39   N/A
Diff-H    0.31   N/A

As you can see, they are almost the same as those of HPACK 08.

Just FYI.

--Kazu

> Hi,
> 
> As you may remember, I implemented several HPACK *encoding* algorithms
> and calculated compression ratio. I tried it again based on HPACK
> 08. I have 8 algorithms.
> 
> - Naive    -- No compression
> - Naive-H  -- Using Huffman only
> - Static   -- Using static table only
> - Static-H -- Using static table and Huffman
> - Linear   -- Using header table
> - Linear-H -- Using header table and Huffman
> - Diff     -- Using header table and reference set
> - Diff-H   -- Using header table, reference set and Huffman
> 
> The implementations above pass all test cases in
> https://github.com/http2jp/hpack-test-case/.  Using this test cases as
> input, I calculated compression ratio again. The ratio is calculated
> by dividing the number of bytes after compression by that before
> compression.
> 
> Here is results:
> 
> Naive     1.10
> Naive-H   0.86
> Static    0.84
> Static-H  0.66
> Linear    0.39 
> Linear-H  0.31
> Diff      0.39
> Diff-H    0.31
> 
> Linear-H and Diff-H results in almost the same. To my calculation,
> Diff-H is only 1.6 byte shorter than Linear-H in average. This means
> that reference set does NOT much contribute to compress headers
> although it is very difficult to implement.
> 
> I have NOT seen any header examples for which reference set work
> effectively so far.
> 
> So, if the authors of HPACK want to retain reference set, I would like
> to see evidence that there are some cases in which reference set
> contributes the compression ratio. HPACK 08 says "Updated Huffman
> table, using data set provided by Google". So, I guess that the
> authors can calculate the compression ratio based on this data.
> 
> If there is not such an evidence, I would like to strongly recommend
> to remove reference set from HPACK. This makes HPACK much simpler, so
> implementations gets bug less and inter-operability is improved. Plus,
> the order of headers is reserved always.
> 
> Regards,
> 
> --Kazu