Re: [hybi] frame length encoding

John Tamplin <jat@google.com> Sun, 22 August 2010 16:29 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 D424D3A688B for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 09:29:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.859
X-Spam-Level:
X-Spam-Status: No, score=-105.859 tagged_above=-999 required=5 tests=[AWL=0.117, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, 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 6dzeurf4xdFt for <hybi@core3.amsl.com>; Sun, 22 Aug 2010 09:29:42 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [216.239.44.51]) by core3.amsl.com (Postfix) with ESMTP id AB3EC3A67DA for <hybi@ietf.org>; Sun, 22 Aug 2010 09:29:42 -0700 (PDT)
Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id o7MGUGDO024772 for <hybi@ietf.org>; Sun, 22 Aug 2010 09:30:16 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1282494616; bh=x1RkN+JJz7aLfzdzM+GijJFJOIg=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DSLKWJzLki3uriOkFqYqX/teLch3izqpvWGpwWGbDVvleqtZ25qG0iUTQUz20DwA4 cHpxIAWoFmotnF0KNdZJw==
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=f0JczAw6ww0MZ9Aysx5OZky8zWRD6QLgdIQxoiW1JDBfGxhktwo8JiKGIQI2NiSMV aMn84hClzrJ6E9pdsging==
Received: from yxn22 (yxn22.prod.google.com [10.190.4.86]) by kpbe14.cbf.corp.google.com with ESMTP id o7MGUEde001581 for <hybi@ietf.org>; Sun, 22 Aug 2010 09:30:15 -0700
Received: by yxn22 with SMTP id 22so1168427yxn.35 for <hybi@ietf.org>; Sun, 22 Aug 2010 09:30:14 -0700 (PDT)
Received: by 10.150.203.5 with SMTP id a5mr3922211ybg.437.1282494614222; Sun, 22 Aug 2010 09:30:14 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.151.60.3 with HTTP; Sun, 22 Aug 2010 09:29:54 -0700 (PDT)
In-Reply-To: <fb8bfae1b88ade55cad4234af724004b.squirrel@sm.webmail.pair.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> <b95f074b65875865802f532bb5668ff2.squirrel@sm.webmail.pair.com> <AANLkTi=AXLFPSASV2zkBiUU=1StO=YSrKq_9AZ2ZnVHy@mail.gmail.com> <8cd6ecfebb4a073ecf94c8e1aa56e642.squirrel@sm.webmail.pair.com> <77aecf89c6c8673f1b999f80fa04e005.squirrel@sm.webmail.pair.com> <AANLkTik9tpCQr9LjK0qdLuA1KfJv1MN9yK2UZ1ytxfCW@mail.gmail.com> <fb8bfae1b88ade55cad4234af724004b.squirrel@sm.webmail.pair.com>
From: John Tamplin <jat@google.com>
Date: Sun, 22 Aug 2010 12:29:54 -0400
Message-ID: <AANLkTimAu5de0PnujHRwR0nnXFBpqdJoRWZ=UvGrLVJ7@mail.gmail.com>
To: shelby@coolpage.com
Content-Type: multipart/alternative; boundary="000e0cd2e552e837f8048e6c0b3b"
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: Sun, 22 Aug 2010 16:29:43 -0000

On Sun, Aug 22, 2010 at 12:22 PM, Shelby Moore <shelby@coolpage.com> wrote:

> But I think you are missing my point as follows?
>
> Any ends that have a CPU load problem due to multi-core synchronization
> overhead, may set their maximum size to 125, if eliminating the
> conditional test will improve throughput. The downside is that is a lot of
> fragmentation that would not be necessary for the large source frames.
>

I think it is ridiculous to suggest an implementation would avoid a couple
of conditional tests and instead would fragment a large frame into 125-byte
frames to save CPU - the cost of the doing the fragmentation will dwarf the
few instructions.


> The CPU load problem improves the larger the maximum frame can be, but
> apparently not if there is conditionals in the size. That was the only
> reason I proposed Option 1/15-bit, which gives a maximum frame size of
> 32767 without any conditionals,


There is still a check of whether the value is the flag to indicate an
8-byte length.  Having 2 compares to byte constants and associated branches
instead of 1 compare to a short constant and a branch seems hardly a
significant additional processing requirement.


> and the cost is only adds 1 byte to header
> for frame sizes smaller than 126, and removes 1 byte for the 2% of frame
> sizes between 126 - 32767.
>

Yes, and my point above is that you add a byte in the 98% case and save a
byte for the <2% case, which on average costs at least 0.96 bytes more per
frame.

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