Re: [netmod] RFC7952 JSON streaming decoding efficiency?

"Rob Wilton (rwilton)" <> Thu, 28 February 2019 09:55 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 90959130E94 for <>; Thu, 28 Feb 2019 01:55:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id RXSuxVTSfZvX for <>; Thu, 28 Feb 2019 01:54:58 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 78B7A130E6B for <>; Thu, 28 Feb 2019 01:54:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=1914; q=dns/txt; s=iport; t=1551347698; x=1552557298; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=vKKQ5G02nfJvxplJ8C++lUkPG4rQsPEIao81iNcYPu0=; b=ZiCdhYMgMtiEY57tblZbePhZ+Pb8bIaXbLctS8Ye2dTrlKGxXK5/TnAw 2MoChPs535imIA5Svf0MQ3dyTFFXcC4BWAo0RAsRqJMaND1cTn2In0WrR L97ZI2s4r7xGxT9onF7osFaz6R2M2MBUtaz/mH3Lvik4KewGO3+wD+uj3 E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-AV: E=Sophos;i="5.58,423,1544486400"; d="scan'208";a="240690478"
Received: from ([]) by with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2019 09:54:57 +0000
Received: from ( []) by (8.15.2/8.15.2) with ESMTPS id x1S9svgn023855 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 28 Feb 2019 09:54:57 GMT
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 28 Feb 2019 03:54:57 -0600
Received: from ([]) by ([]) with mapi id 15.00.1395.000; Thu, 28 Feb 2019 03:54:57 -0600
From: "Rob Wilton (rwilton)" <>
To: Robert Varga <>, "" <>
Thread-Topic: [netmod] RFC7952 JSON streaming decoding efficiency?
Thread-Index: AQHUzuuJVNQCQ66ge0a+WQBULprZtqX08KGAgABrEoD//5yWEA==
Date: Thu, 28 Feb 2019 09:54:57 +0000
Message-ID: <>
References: <> <> <>
In-Reply-To: <>
Accept-Language: en-GB, en-US
Content-Language: en-US
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: []
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [netmod] RFC7952 JSON streaming decoding efficiency?
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 28 Feb 2019 09:55:01 -0000

Broadly sounds like a reasonable idea to me, but I suspect that others may argue that you are just creating a new JSON like language.

If we were to investigate anything like this, then it might also be a good idea to consider the ordering of list keys within a list entry (i.e. put them first).


-----Original Message-----
From: Robert Varga <> 
Sent: 28 February 2019 09:46
To: Rob Wilton (rwilton) <>;
Subject: Re: [netmod] RFC7952 JSON streaming decoding efficiency?

On 28/02/2019 10:29, Rob Wilton (rwilton) wrote:
> Hi Robert,

Hey Rob,

> Isn't this just a limitation of JSON, in that the elements in an object are unordered (RFC 8259)?

Yes, but I believe this is object semantics leaking to on-wire format:
while a JSON object is inherently unordered, when emitting object to the wire, implementations can choose to order the pairs to make receiver-side processing more efficient.

I wonder if it would be of value to communicate such assumptions out of band, like separate content-types. In case of RFC7952 the following hints would be useful:
- the document does not contain metadata (i.e. plain RFC7951)
- "@" occurs as a first element in an object or not at all
- "@foo" occurs immediately after "foo" or not at all

This, of course, would be purely optional optimization...