Re: [netmod] RFC7952 JSON streaming decoding efficiency?

Robert Varga <> Thu, 28 February 2019 09:46 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 04F7B130E79 for <>; Thu, 28 Feb 2019 01:46:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] 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 TJMrKUiypucL for <>; Thu, 28 Feb 2019 01:46:44 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id D52B9130E6B for <>; Thu, 28 Feb 2019 01:46:43 -0800 (PST)
Received: from nitebug.nitenet.local (unknown []) by (Postfix) with ESMTPSA id 8C430241BD1; Thu, 28 Feb 2019 10:46:41 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=mail; t=1551347201; bh=LrWS2X7jQOz5TyWrtYl73Kj84azD6ZOi186YsRFDL6M=; h=Subject:To:References:From:Date:In-Reply-To; b=R4UGGKbGZjj1xSLMmdQal3PysQI69wv2iSjlN6Vi9NSiQjTqBS6lmJICs8ahVkGPC KKJbEYmVLseqXo3L5XeE90TCYSFY5vFrCVzCJ2XTP3hLWHh1yCfojDc/tInaWlLZs8 5o26ppWJETU4BcUFUpQTkDU4Oy8kzRQKO1m4lrdU=
To: "Rob Wilton (rwilton)" <>, "" <>
References: <> <>
From: Robert Varga <>
Openpgp: preference=signencrypt
Message-ID: <>
Date: Thu, 28 Feb 2019 10:46:29 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="UKpMMzpS5NEfoBbVR1RVPRl9YJjN8wXM0"
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:46:46 -0000

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...