Re: [hybi] frame length encoding

John Tamplin <jat@google.com> Sat, 21 August 2010 20:11 UTC

Return-Path: <jat@google.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 695293A6961 for <hybi@core3.amsl.com>; Sat, 21 Aug 2010 13:11:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.697
X-Spam-Level:
X-Spam-Status: No, score=-105.697 tagged_above=-999 required=5 tests=[AWL=-0.036, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, SARE_MILLIONSOF=0.315, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWsoNSKprXfs for <hybi@core3.amsl.com>; Sat, 21 Aug 2010 13:11:36 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id AF0EA3A6954 for <hybi@ietf.org>; Sat, 21 Aug 2010 13:11:36 -0700 (PDT)
Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id o7LKCAJg007346 for <hybi@ietf.org>; Sat, 21 Aug 2010 13:12:10 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282421530; bh=XAFOgwCDs1U+CiRWTdU2rDRHb18=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bzSljcnkBtacf3d/VeYiQ3xsK6JYrLf9/CuI4HhgZb2FUoKTm9MstYoCRPni8RXff CTJw7QrO9hMCaHCaRPHdw==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:from:date:message-id: subject:to:cc:content-type:x-system-of-record; b=Gg9/hOGu+xA3/QRrw9qXKu1uGL+7+4HYspVp6uHpTv05WC/Vz1raTsF/Dl7ztGE9A gGzNV/8+I0cdSfplEKTbA==
Received: from gxk28 (gxk28.prod.google.com [10.202.11.28]) by hpaq12.eem.corp.google.com with ESMTP id o7LKC8ec013294 for <hybi@ietf.org>; Sat, 21 Aug 2010 13:12:08 -0700
Received: by gxk28 with SMTP id 28so2345154gxk.10 for <hybi@ietf.org>; Sat, 21 Aug 2010 13:12:08 -0700 (PDT)
Received: by 10.151.101.19 with SMTP id d19mr3317134ybm.330.1282421526197; Sat, 21 Aug 2010 13:12:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.60.3 with HTTP; Sat, 21 Aug 2010 13:11:46 -0700 (PDT)
In-Reply-To: <AANLkTi=VE298Tg+qyfufhzMswE5pBxtPZhA0t2k=sf2A@mail.gmail.com>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <20100820192927.GA32620@1wt.eu> <4C6EEA55.2050205@hs-weingarten.de> <AANLkTinHqxUOZaVANFpC52t8FfgNw2L5_A-s9Az3Fm7p@mail.gmail.com> <AANLkTinvkxMP8FYz9xjDu_Kt9FfzYotgsqXUDB4MZMEo@mail.gmail.com> <AANLkTim3KRq1arso7wN_b+1TH3sWabYW6uFu7AbYw6-P@mail.gmail.com> <AANLkTikhhajho895WyEoJMwMk9GJ98kA0Mjy5qr4apC8@mail.gmail.com> <AANLkTi=kdk6BRvza_7bpoLNTFzUkjcRRijGLMe_NGXZV@mail.gmail.com> <AANLkTi=VE298Tg+qyfufhzMswE5pBxtPZhA0t2k=sf2A@mail.gmail.com>
From: John Tamplin <jat@google.com>
Date: Sat, 21 Aug 2010 16:11:46 -0400
Message-ID: <AANLkTin2sNji3J98VqacammHFS=DJHmpq5zY_mTFNt8Z@mail.gmail.com>
To: Pieter Hintjens <ph@imatix.com>
Content-Type: multipart/alternative; boundary="00151750ef028575e8048e5b07bc"
X-System-Of-Record: true
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] frame length encoding
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 21 Aug 2010 20:11:40 -0000

On Sat, Aug 21, 2010 at 3:59 PM, Pieter Hintjens <ph@imatix.com> wrote:

> On Sat, Aug 21, 2010 at 9:34 PM, John Tamplin <jat@google.com> wrote:
>
> > But those are going to be highly compressible, and will easily compress
> to
> > under 126 bytes, even with some application level framing around them.
>
> Compression is not an option for low-latency cases (where volumes are
> in the millions of messages /second).  We're already finding that
> zero-copy techniques halve the cost of processing.  So the sweet spot
> for these really high volume messages remains above 127 bytes IMO.
> However, websockets is not intended for the financial markets, and
> probably won't ever be used for such volumes.


Obviously, I don't know the details of your environment, but I suspect CPU
speed will continue to increase faster than network speeds.  Already, it is
nearly even between the time to send the extra bits and the time to compress
them, so over time I suspect that we will see compression used even more.


> > The main difference between #0 and #1 is that #0 uses one of three
> reserved
> > bits.  They are easy to spend, but then when we find out we need them it
> > becomes much more expensive to get them back.
>
> Indeed.  Adding another 8 reserved bits in the header does not seem
> wasteful.
>
> Again, I plead for simplicity.  Mixing a length with other bits just
> makes it more complex to process WebSocket frames and the benefits
> seem marginal.
>

I am a bit confused at your position -- in one sentence you suggest we
should add another byte just in case we might use it, yet you are still
worried about a single AND instruction?  Surely the cost of sending that
byte is higher than one instruction?

Regardless of the differences between #0 and #1, it already seemed clear
that #1 was losing out to #2 or yet more complicated schemes, so I don't
think option #0, which removes the one advantage compared to #3 or Shelby's
proposal of preserving a reserved bit, will get any more backers than #1
did.

-- 
John A. Tamplin
Software Engineer (GWT), Google