Re: [apps-discuss] JSON Patch: Shortening operation names?

Dave Cridland <dave@cridland.net> Tue, 06 December 2011 12:18 UTC

Return-Path: <dave@cridland.net>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41A8E21F8488 for <apps-discuss@ietfa.amsl.com>; Tue, 6 Dec 2011 04:18:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nnMheUvuUxx1 for <apps-discuss@ietfa.amsl.com>; Tue, 6 Dec 2011 04:18:20 -0800 (PST)
Received: from peirce.dave.cridland.net (peirce.dave.cridland.net [IPv6:2001:470:1f09:882:2e0:81ff:fe29:d16a]) by ietfa.amsl.com (Postfix) with ESMTP id C163121F8480 for <apps-discuss@ietf.org>; Tue, 6 Dec 2011 04:18:19 -0800 (PST)
Received: from localhost (peirce.dave.cridland.net [127.0.0.1]) by peirce.dave.cridland.net (Postfix) with ESMTP id EB3591168087; Tue, 6 Dec 2011 12:18:17 +0000 (GMT)
X-Virus-Scanned: Debian amavisd-new at peirce.dave.cridland.net
Received: from peirce.dave.cridland.net ([127.0.0.1]) by localhost (peirce.dave.cridland.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VRZFf1T7C3P2; Tue, 6 Dec 2011 12:18:01 +0000 (GMT)
Received: from puncture (puncture.dave.cridland.net [IPv6:2001:470:1f09:882:221:85ff:fe3f:1696]) by peirce.dave.cridland.net (Postfix) with ESMTPA id 7547D1168067; Tue, 6 Dec 2011 12:18:01 +0000 (GMT)
References: <1323136558.12382.28.camel@neutron> <4EDDEE37.1020501@ninebynine.org>
In-Reply-To: <4EDDEE37.1020501@ninebynine.org>
MIME-Version: 1.0
Message-Id: <3373.1323173881.459586@puncture>
Date: Tue, 06 Dec 2011 12:18:01 +0000
From: Dave Cridland <dave@cridland.net>
To: Graham Klyne <GK@ninebynine.org>, General discussion of application-layer protocols <apps-discuss@ietf.org>, "Paul C\. Bryan" <paul.bryan@forgerock.com>
Content-Type: text/plain; delsp="yes"; charset="us-ascii"; format="flowed"
Subject: Re: [apps-discuss] JSON Patch: Shortening operation names?
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Dec 2011 12:18:21 -0000

On Tue Dec  6 10:28:07 2011, Graham Klyne wrote:
> I'd be inclined to stick with the readable names, unless there's a  
> clear case that the extra bytes will have significant effect on  
> performance.

Shrt nms tnd 2 rduc rdblty 4 0 effct.

Put another way, reducing the length of the names is merely making  
particular packets shorter. This is likely to have an effect only if  
using certain low-level network types (such as 3G mobile), and if the  
middle layers arethemselves sufficiently terse. I've been assuming  
(without, I hasten to add, reading the draft) that this is all going  
over HTTP, which will render any saving to be a wasted effort.

If we're running under some more optimal protocol, and over a  
link-layer which is genuinely low bandwidth (like SATCOM, HF, etc)  
then yes this will make a difference, but also you can use deflate,  
and in extreme cases you can preload the dictionary with typical  
patch operations, which is quite likely to reduce the names to  
fractional bytes very effectively.

Finally, on HTTP itself, running over TLS with compression enabled  
will yield much lower bandwidth then a C-E, for payloads of this  
type, so that's a much more effective argument.

(A small note - it *would* be worthwhile reducing the verbs if the  
distance between JSON patch operations - that is, the size of the  
entire HTTP request, uncompressed - would exceed 32k, and making it  
more terse would bring it radically under.)

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