Re: [hybi] max frame size, was: frame length encoding

Scott Ferguson <ferg@caucho.com> Sun, 22 August 2010 23:23 UTC

Return-Path: <ferg@caucho.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 91DDF3A6890 for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 16:23:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.508
X-Spam-Level:
X-Spam-Status: No, score=-2.508 tagged_above=-999 required=5 tests=[AWL=0.091, BAYES_00=-2.599]
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 VR6PoFysw9us for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 16:23:08 -0700 (PDT)
Received: from smtp112.biz.mail.mud.yahoo.com (smtp112.biz.mail.mud.yahoo.com [209.191.68.77]) by core3.amsl.com (Postfix) with SMTP id C63C83A686B for <hybi@ietf.org>; Sun, 22 Aug 2010 16:23:07 -0700 (PDT)
Received: (qmail 20275 invoked from network); 22 Aug 2010 23:23:41 -0000
Received: from [192.168.1.11] (ferg@66.92.8.203 with plain) by smtp112.biz.mail.mud.yahoo.com with SMTP; 22 Aug 2010 16:23:41 -0700 PDT
X-Yahoo-SMTP: L1_TBRiswBB5.MuzAo8Yf89wczFo0A2C
X-YMail-OSG: fCtK8ZEVM1lU9q12jfGyH1Qq16f5GXJ3yCo.kPHZRfdSuTC fAiQMDRrkXfBsb9baQdUi3MYpylkwsnxFD.fAMyPmNRL74uqAEjSeqx_tWOx Iy.XS1lCuN4YPfDd.FqyMqYdcqanY6Nlf2.y_nkzv0Rj_G2swrZwOMKsM9Dv By_oe_bd7J1EVw7wPUIvtmOHcXydzqm8E6qjPYEloErzshxHS8y0dhTwtax2 cO4w9ERcL5SIqJl.Gdmm3bBZtY0yZ1W50cSjfKCdy.62yoyN6QULOeB5R2uk wtWvgHYRmRKLuNkZI2g.V7Q--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <4C71B171.3080308@caucho.com>
Date: Sun, 22 Aug 2010 16:23:29 -0700
From: Scott Ferguson <ferg@caucho.com>
User-Agent: Thunderbird 2.0.0.24 (X11/20100411)
MIME-Version: 1.0
To: Pieter Hintjens <ph@imatix.com>
References: <AANLkTimKbmcpgx8k0uXUWvCO=8w9pPrtV=3y4qh6363k@mail.gmail.com> <alpine.DEB.2.00.1008212037190.27211@tvnag.unkk.fr> <AANLkTinrsT+wV48nHvVW_1ChGYffkq7jisU2-PZnMyKg@mail.gmail.com> <alpine.DEB.2.00.1008212123460.27211@tvnag.unkk.fr> <20ef7ed5e135c57c1ee5a741658b9d98.squirrel@sm.webmail.pair.com> <1282423311.2014.6.camel@tng> <224b9ed365bd78fd5e316b8cb5f3f837.squirrel@sm.webmail.pair.com> <1282435214.2014.14.camel@tng> <AANLkTimo0MwZEMn1t1vrASfwC1bx82Q9Z_Ls3wVb-zUS@mail.gmail.com> <AANLkTimQxo0d9TW+ApKLfWrSwutMYL4MJBVRWtxP1sC5@mail.gmail.com> <4C71555D.9010600@gmx.de> <AANLkTin-Zk6zJogwXsteqa=SW1E7mX=Nv3n1_u5fz4Ea@mail.gmail.com>
In-Reply-To: <AANLkTin-Zk6zJogwXsteqa=SW1E7mX=Nv3n1_u5fz4Ea@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] max frame size, was: 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: Sun, 22 Aug 2010 23:23:10 -0000

Pieter Hintjens wrote:
> The only cases that really matter here are:
>
> - very short frames, where every byte is significant
> - very long frames, where any ceiling is significant
>
> Medium length frames can be treated as long frames with zero
> significant cost.  You could stick a 100-byte header on a 100K frame
> and it would not be significant.
>
> There is no point optimizing any case except the two: very short (trim
> space), very long (trim complexity).
>   

That's only true when you know the length before serializing the 
payload. For dynamic content like JSON or a Wave stanza, which are 
frequently short, the medium length of the serialization buffer is 
better, which is why the 1/2/8 variations like option #2 are good 
compromises.

1 is best for hand-optimized protocols like Quake.
2 is best for dynamic content that is frequently short
8 is best for sendfile

-- Scott