Re: Header Serialization Discussion

James M Snell <jasnell@gmail.com> Tue, 16 April 2013 17:53 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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2D11D21F934C for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 16 Apr 2013 10:53:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.099
X-Spam-Level:
X-Spam-Status: No, score=-9.099 tagged_above=-999 required=5 tests=[AWL=0.900, BAYES_00=-2.599, J_CHICKENPOX_63=0.6, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vI8EqxPZJj8M for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 16 Apr 2013 10:53:10 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 8DDFB21F92C2 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 16 Apr 2013 10:53:10 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1USA32-0003gq-7v for ietf-http-wg-dist@listhub.w3.org; Tue, 16 Apr 2013 17:52:04 +0000
Resent-Date: Tue, 16 Apr 2013 17:52:04 +0000
Resent-Message-Id: <E1USA32-0003gq-7v@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <jasnell@gmail.com>) id 1USA2v-0003g4-KW for ietf-http-wg@listhub.w3.org; Tue, 16 Apr 2013 17:51:57 +0000
Received: from mail-ob0-f177.google.com ([209.85.214.177]) by maggie.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <jasnell@gmail.com>) id 1USA2u-0002CZ-K4 for ietf-http-wg@w3.org; Tue, 16 Apr 2013 17:51:57 +0000
Received: by mail-ob0-f177.google.com with SMTP id ef5so152842obb.8 for <ietf-http-wg@w3.org>; Tue, 16 Apr 2013 10:51:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=fOPS9hyMxflAldi+C+C95s21mLK2QGThs2IZWzwykvU=; b=hlwwJOAKVMgGooht0HNFctJn8HEYqhYYQ8m7pTm7MtfZUmK0zjwxk/HINiliLAgyl4 S1TIRxxZXsmP2DdVOouRUDXaHFQ6csC0gQR7Sxc0RlN46QkOb0+xBIHPNG+lC/9NcTar 0RTWAZcw9Vtg/e4vnzQIfh3mGEjAcNdtB4UsMoGqQUPA6U1oXrL9wf8mjFnz8+TvKK0b spxsbgt7K4YCuvoSiHmWaUtKsvVHIabGuN2UIvfDib7LUqk1r4q5Qdu+UW7e0GTg7ztK jgh4qh5oY2vc/Qd4cqmWkyr0E+FvpDWH5BCu7z8FuVMKfU1cjDEdikWZSUGGdZijhYha 0uxw==
X-Received: by 10.60.17.35 with SMTP id l3mr1194759oed.135.1366134690455; Tue, 16 Apr 2013 10:51:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.60.132.102 with HTTP; Tue, 16 Apr 2013 10:51:10 -0700 (PDT)
In-Reply-To: <6C71876BDCCD01488E70A2399529D5E5164113A5@ADELE.crf.canon.fr>
References: <CABP7RbfUH=U0hjcmEXKO1jJzy7pPffqFDE4TmAs-ahBX04qwJw@mail.gmail.com> <6C71876BDCCD01488E70A2399529D5E51640F0D1@ADELE.crf.canon.fr> <CABP7Rbcvqas52h8hJatDgqVQsnH3dHAkZREHTLU=ADKbx=0uSQ@mail.gmail.com> <6C71876BDCCD01488E70A2399529D5E5164113A5@ADELE.crf.canon.fr>
From: James M Snell <jasnell@gmail.com>
Date: Tue, 16 Apr 2013 10:51:10 -0700
Message-ID: <CABP7RbdknWYqUhukCArQim9tZZPsf+wU29PXpBw19p7hKjdwBA@mail.gmail.com>
To: RUELLAN Herve <Herve.Ruellan@crf.canon.fr>
Cc: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=209.85.214.177; envelope-from=jasnell@gmail.com; helo=mail-ob0-f177.google.com
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-2.696, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1USA2u-0002CZ-K4 b5a5b11cb82333bd3b42757127231693
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Header Serialization Discussion
Archived-At: <http://www.w3.org/mid/CABP7RbdknWYqUhukCArQim9tZZPsf+wU29PXpBw19p7hKjdwBA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17261
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>

The compression ratio for requests will be a bit lower, yes, but I'm
purposefully trading off simplified, more predictable and more
controlled state management and higher throughput. I'm looking now to
see how best to support the shared prefix stuff using the typed codecs
to get more compression out of it. The compression ratio for responses
tends to be significantly better than delta2 and headerdiff in
testing, largely due to the use of the typed codecs.

Here are the test numbers I'm currently getting running against the
amazon.har  (dhe = "delta header encoding".. which is the new impl
based on what I described).

Requests:
               size  time | ratio min   max   std
     http1  200,876  0.01 | 1.00  1.00  1.00  0.00
       dhe   71,352  0.08 | 0.36  0.00  0.71  0.15
    delta2   35,850  0.37 | 0.18  0.03  0.67  0.12
headerdiff   38,673  0.23 | 0.19  0.03  0.88  0.16

Responses:
               size  time | ratio min   max   std
     http1  160,435  0.06 | 1.00  1.00  1.00  0.00
       dhe   37,132  0.02 | 0.23  0.00  0.66  0.11
    delta2   42,764  0.43 | 0.27  0.02  0.65  0.10
headerdiff   46,321  0.69 | 0.29  0.04  0.84  0.13


- James

On Tue, Apr 16, 2013 at 9:06 AM, RUELLAN Herve
<Herve.Ruellan@crf.canon.fr> wrote:
>
>
>> -----Original Message-----
>> From: James M Snell [mailto:jasnell@gmail.com]
>> Sent: lundi 15 avril 2013 17:55
>> To: RUELLAN Herve
>> Cc: ietf-http-wg@w3.org
>> Subject: Re: Header Serialization Discussion
>>
>> [snip]
>>
>> > My main concern with your proposal is about doing the LRU on both the
>> encoder and the decoder.
>> > I'd really like to keep the decoder as simple as possible, and so keeping all
>> the buffer management on the encoder side is a real win for me.
>> > In addition, the asymmetry means that the encoder is free to do whatever
>> buffer management it wants. LRU is a very good default buffer management
>> scheme, however I think there are cases where some clever scheme could
>> beat it.
>>
>> Well, it's not so much an LRU cache as a "least recently written"
>> queue. The buffer essentially consists of 128 memory slots. These are
>> assigned in order and rotate, with used slots deallocated and reassigned as
>> the buffer fills past it's limit. The encoder, then, needs to be selective about
>> just what it decides to assign to the buffer. So long as an implementation
>> follows the proper assignment order, the specific implementation does not
>> matter.
>>
>
> I'm afraid that using a "least recently written" queue would have a bad impact on compaction performances. There are some headers that don't change over a whole session (e.g. the user agent), or only take a few values over the whole session (e.g. accept). With a rotating scheme, these headers would have to be periodically re-added to the buffer.
>
> Hervé.