Re: [hybi] Framing take IV [why fragment]

Dave Cridland <dave@cridland.net> Thu, 05 August 2010 15:51 UTC

Return-Path: <dave@cridland.net>
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 2A3F03A67C3 for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 08:51:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.475
X-Spam-Level:
X-Spam-Status: No, score=-2.475 tagged_above=-999 required=5 tests=[AWL=0.124, 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 AdpX71gpyrPc for <hybi@core3.amsl.com>; Thu, 5 Aug 2010 08:51:05 -0700 (PDT)
Received: from peirce.dave.cridland.net (peirce.dave.cridland.net [217.155.137.61]) by core3.amsl.com (Postfix) with ESMTP id B12E83A67B3 for <hybi@ietf.org>; Thu, 5 Aug 2010 08:51:04 -0700 (PDT)
Received: from localhost (localhost.localdomain [127.0.0.1]) by peirce.dave.cridland.net (Postfix) with ESMTP id BEBEA116809F; Thu, 5 Aug 2010 16:51:34 +0100 (BST)
X-Virus-Scanned: Debian amavisd-new at peirce.dave.cridland.net
Received: from peirce.dave.cridland.net ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2C7dync2XT8i; Thu, 5 Aug 2010 16:51:33 +0100 (BST)
Received: from puncture (puncture [217.155.137.60]) by peirce.dave.cridland.net (Postfix) with ESMTPA id 0E29D116809E; Thu, 5 Aug 2010 16:51:33 +0100 (BST)
References: <AANLkTinyrDoG5d_Ur6HVRy=SgMPjLzJtpJ++Ye=1DQdj@mail.gmail.com> <Pine.LNX.4.64.1008040050040.5947@ps20323.dreamhostps.com> <1280932393.7561.271.camel@tng> <2286.1281017237.786534@puncture> <AANLkTimWeL5Td0_H0+q+p=CpPqy-GAdhiKxqr5yyGNzL@mail.gmail.com>
In-Reply-To: <AANLkTimWeL5Td0_H0+q+p=CpPqy-GAdhiKxqr5yyGNzL@mail.gmail.com>
MIME-Version: 1.0
Message-Id: <2286.1281023493.052316@puncture>
Date: Thu, 05 Aug 2010 16:51:33 +0100
From: Dave Cridland <dave@cridland.net>
To: John Tamplin <jat@google.com>, Patrick McManus <mcmanus@ducksong.com>, Server-Initiated HTTP <hybi@ietf.org>
Content-Type: text/plain; delsp="yes"; charset="us-ascii"; format="flowed"
Subject: Re: [hybi] Framing take IV [why fragment]
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: Thu, 05 Aug 2010 15:51:06 -0000

On Thu Aug  5 16:38:58 2010, John Tamplin wrote:
> On Thu, Aug 5, 2010 at 10:07 AM, Dave Cridland <dave@cridland.net>  
> wrote:
> 
> > On Wed Aug  4 15:33:13 2010, Patrick McManus wrote:
> >
> >> On Wed, 2010-08-04 at 00:53 +0000, Ian Hickson wrote:
> >> >  I could see an argument for supporting
> >> > fragmentation in the case of multiplexing, but without that it  
> doesn't
> >> > seem to actually gain us anything.
> >>
> >> In the absence of fragmentation the sender must have the entire  
> message
> >> available in order to prefix the total length in the header - so  
> it
> >> engages in store and forward instead of streaming behavior.
> >>
> >>
> >>  I think some of these are bad arguments.
> 
> 
> Imagine we have frame-based compression (I know this still up for  
> debate,
> though I think a good case has been made that we need to be able to  
> compress
> some payloads and not others).

Oh, sure. But that doesn't mean we need to have compression at the  
frame layer.

>   Then the code is going to look something
> like this:
> 
> empty output buffer
> while there is input data
>     read the next buffer full (if not already in a byte  
> array/string)
>     while the input buffer is not empty
>       compress the input buffer into the output buffer
>       if output buffer is full, send a non-final frame with the  
> output
> buffer and clear it
>       advance the input buffer pointer
>     end while
> end while
> send a final frame with the output buffer
> 
> If we don't have chunking, we must buffer the entire compressed  
> output in
> memory, which means allocating and reallocating an arbitrarily  
> large buffer
> rather than sending each output buffer's full of data.
> 
> 
This, OTOH, is a good argument - and there's other similar ones.


> No, because the receiver cnnot process portions of messages - at  
> least with
> > our current API. And you can achieve this behaviour by sending  
> multiple
> > messages anyway.
> 
> 
> For per-frame compression, you certainly can decompress each chunk  
> as you
> receive it.  Yes, the JS API currently does not have a way to pass  
> partial
> messages, and perhaps that needs to get fixed when binary support  
> is added
> since it seems more likely you will want to be able to react to  
> partial
> messages as each part is received.

I think the definition of a message is something that an application  
programmer can sensibly write code to react to, so I'd disagree.

Dave.
-- 
Dave Cridland - mailto:dave@cridland.net - xmpp:dwd@dave.cridland.net
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade