Re: timestamps encoding
Amos Jeffries <squid3@treenet.co.nz> Wed, 22 October 2014 02:11 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 74AE31A8A0F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 21 Oct 2014 19:11:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.912
X-Spam-Level:
X-Spam-Status: No, score=-6.912 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 jFjht61gOH5B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 21 Oct 2014 19:11:38 -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 486701A89E0 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 21 Oct 2014 19:11:37 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1XglLr-0001oE-MX for ietf-http-wg-dist@listhub.w3.org; Wed, 22 Oct 2014 02:08:39 +0000
Resent-Date: Wed, 22 Oct 2014 02:08:39 +0000
Resent-Message-Id: <E1XglLr-0001oE-MX@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1XglLn-0001nP-4d for ietf-http-wg@listhub.w3.org; Wed, 22 Oct 2014 02:08:35 +0000
Received: from 121-99-228-82.static.orcon.net.nz ([121.99.228.82] helo=treenet.co.nz) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1XglLl-0008JK-PM for ietf-http-wg@w3.org; Wed, 22 Oct 2014 02:08:34 +0000
Received: from [192.168.2.97] (unknown [203.184.52.78]) by treenet.co.nz (Postfix) with ESMTP id 47D61E6E89 for <ietf-http-wg@w3.org>; Wed, 22 Oct 2014 15:08:01 +1300 (NZDT)
Message-ID: <5447117F.6050006@treenet.co.nz>
Date: Wed, 22 Oct 2014 15:07:59 +1300
From: Amos Jeffries <squid3@treenet.co.nz>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
MIME-Version: 1.0
To: ietf-http-wg@w3.org
References: <20141016091626.GC3079@1wt.eu> <34008D72-5800-412E-A276-81C6C7BFA9E2@mnot.net> <20141020165353.GA25743@1wt.eu> <8F120E2F-704E-44CB-ACF2-C743B870B2B6@mnot.net> <CAP+FsNdOHVj=YTE35Vj7mbED0OKghd-mpnFZSMcZNBM3JybJDg@mail.gmail.com> <20141021092505.GA30397@1wt.eu> <52739.1413883975@critter.freebsd.dk> <20141021094425.GC30397@1wt.eu> <54462F3F.30502@gmx.de> <20141021102016.GG30397@1wt.eu> <20141021142451.GJ30397@1wt.eu> <op.xn3xphjviw9drz@beryllium.oslo.osa>
In-Reply-To: <op.xn3xphjviw9drz@beryllium.oslo.osa>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=121.99.228.82; envelope-from=squid3@treenet.co.nz; helo=treenet.co.nz
X-W3C-Hub-Spam-Status: No, score=-3.5
X-W3C-Hub-Spam-Report: AWL=-3.450, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001
X-W3C-Scan-Sig: lisa.w3.org 1XglLl-0008JK-PM 83133b121bb736525613506950665d32
X-Original-To: ietf-http-wg@w3.org
Subject: Re: timestamps encoding
Archived-At: <http://www.w3.org/mid/5447117F.6050006@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/27668
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>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 22/10/2014 2:13 p.m., Martin Nilsson wrote: > On Tue, 21 Oct 2014 16:24:51 +0200, Willy Tarreau wrote: > >> >> The example code below converts valid strings to their compacted >> form and leaves the non-convertable ones intact. The converted >> string's format indicates what format it's in (ie: if it begins >> with 0xA its a compact one). The gains are interesting, just >> tested on example.com, there are 3 dates there, 24 bytes each, >> and reduced to 5 bytes each, that's 57 bytes saved in one >> response header (19 bytes saved per valid header). >> > > That's before huffman encoding. > > Taking a now:ish timestamp of 1413938411 creates the byte sequence > 0a.84.89.46.56. These 5 bytes are encoded with 89 bits after > huffman encoding, whereas the 10 byte numeric literal "1413938411" > is encoded with 56 bits. Not completely fair since you have an > encoding token in front, which is needed here to distinguish > between time and time offsets. If we pick "t" to mean time, which > is encoded with 5 bits, we get 64 bits for your method and 61 bits > for ASCII, for this example. For this size of numbers you'll get an > average of 4*18.2 = 72.8 bits while ASCII gives 10*5.7 = 57 bits > (plus encoding token). Huffman encoding applies only to String literals. This numeric is an Integer Literal byte sequence. Also, if you are going to signal a binary state (delta vs absolute time) use a 1-bit flag, built into the value type code this wastes no space. As you can see a separate 5-bit String Literal character just biases the encoding towards ASCII. Amos -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQEcBAEBAgAGBQJURxF/AAoJELJo5wb/XPRjbncH/1wuuCk4QoKgeMbm1eNCmCMK jfrK3T7eIsla1gG0+PBvRPtApidO1QpOwtd2mhN0mkO8vNSWN6GI9N5ECgekOQkP uh6TthNlh93iWIQubDhy99SmhbkK1Ii21WzAib3pON3g1kscy9XcGQ/07EwJtQxI 7u/VJtg7S09jSQLbPqXOIWyZ3Ws92gGshdbMtyntsOGMSoIahT6Mi5BJFx4kVYK/ Qe3Z4yn7xeusmGBjFNpwbmAOlIE5f5D7/67F/1hNtO9EClEzxAAp4Mevdfk+xruV b6BNxdkhXTNKbhMMuXbfu+0hB4OeVYRohJmkuY8QQby5YmKMzLyBa4h5z0HAnc8= =49jx -----END PGP SIGNATURE-----
- Re: Restore Header Table and Static Table Indices Nicholas Hurley
- Restore Header Table and Static Table Indices Jeff Pinner
- Re: Restore Header Table and Static Table Indices Kulkarni, Saurabh
- Re: Restore Header Table and Static Table Indices Poul-Henning Kamp
- Straw Poll: Restore Header Table and Static Table… Mark Nottingham
- Re: Restore Header Table and Static Table Indices Ludin, Stephen
- Re: Restore Header Table and Static Table Indices Michael Sweet
- Re: Restore Header Table and Static Table Indices Greg Wilkins
- Re: Restore Header Table and Static Table Indices Daniel Stenberg
- Re: Restore Header Table and Static Table Indices Simpson, Robby (GE Energy Management)
- Re: Restore Header Table and Static Table Indices Roberto Peon
- RE: Restore Header Table and Static Table Indices Mike Bishop
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Shigeki Ohtsu
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Amos Jeffries
- RE: Straw Poll: Restore Header Table and Static T… K.Morgan
- Re: Straw Poll: Restore Header Table and Static T… Nicholas Hurley
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Nicholas Hurley
- RE: Straw Poll: Restore Header Table and Static T… RUELLAN Herve
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Roberto Peon
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Roberto Peon
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Adrian Cole
- Re: Restore Header Table and Static Table Indices Adrian Cole
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Adrian Cole
- Re: Straw Poll: Restore Header Table and Static T… Adrian Cole
- Re: Straw Poll: Restore Header Table and Static T… Amos Jeffries
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Adrian Cole
- RE: Straw Poll: Restore Header Table and Static T… RUELLAN Herve
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Simpson, Robby (GE Energy Management)
- Re: Straw Poll: Restore Header Table and Static T… Simpson, Robby (GE Energy Management)
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Jason Greene
- RE: Straw Poll: Restore Header Table and Static T… RUELLAN Herve
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Mark Nottingham
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Roberto Peon
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Julian Reschke
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Poul-Henning Kamp
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Greg Wilkins
- Re: Straw Poll: Restore Header Table and Static T… Willy Tarreau
- Re: Straw Poll: Restore Header Table and Static T… Jason Greene
- timestamps encoding (was: Re: Straw Poll: Restore… Willy Tarreau
- #578 [was: Straw Poll: Restore Header Table and S… Mark Nottingham
- Re: timestamps encoding (was: Re: Straw Poll: Res… Martin Nilsson
- Re: timestamps encoding Amos Jeffries
- Re: #578 [was: Straw Poll: Restore Header Table a… Amos Jeffries
- Re: #578 [was: Straw Poll: Restore Header Table a… Mark Nottingham
- Re: timestamps encoding Martin Nilsson