Re: [Json] Proposed minimal change for duplicate names in objects

Nico Williams <nico@cryptonector.com> Sun, 07 July 2013 06:25 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EDA5821F9DCD for <json@ietfa.amsl.com>; Sat, 6 Jul 2013 23:25:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.958
X-Spam-Level:
X-Spam-Status: No, score=-1.958 tagged_above=-999 required=5 tests=[AWL=0.019, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 85cRC7VSIjcn for <json@ietfa.amsl.com>; Sat, 6 Jul 2013 23:25:46 -0700 (PDT)
Received: from homiemail-a77.g.dreamhost.com (caiajhbdcbef.dreamhost.com [208.97.132.145]) by ietfa.amsl.com (Postfix) with ESMTP id 7A39621F9E3C for <json@ietf.org>; Sat, 6 Jul 2013 23:25:46 -0700 (PDT)
Received: from homiemail-a77.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a77.g.dreamhost.com (Postfix) with ESMTP id 2C85E9405C for <json@ietf.org>; Sat, 6 Jul 2013 23:25:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type:content-transfer-encoding; s= cryptonector.com; bh=G/jsqUAJB2hJnuhUVBTclYD6nbM=; b=sarlgyGCP/K YjiQriJwzPTwsCvluTq8dqv+vfCOa+rV6AU/Qlt432JZLEg1HhMUOnncFJmnDUZE RY6IeqSlgY0dEpYidpThb17eWKdKjU/hZgh1Mgn3kxym0N/wXyhgr6hWX40/CUmG 6vAmAkVd8ImkIPjR3LMloYdVZhotTFts=
Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a77.g.dreamhost.com (Postfix) with ESMTPSA id D051294059 for <json@ietf.org>; Sat, 6 Jul 2013 23:25:45 -0700 (PDT)
Received: by mail-wg0-f53.google.com with SMTP id y10so2891136wgg.8 for <json@ietf.org>; Sat, 06 Jul 2013 23:25:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=b6I1SX1LxeC//TPavw55ZjfOcdmml7I2IZzzF41lvCo=; b=ZDC/vzYqylkH6Yz8OH8ysV/1p8+2vFWtj990UcaadIYUdkAtXmBBHgfZdDp1gm27Im 8Ip4/12ZHOJPncxlvw1QzDQCLMqLxZ+KL2cF2lxlithTGojW1HMfSlX5gmV7qSBUb9E8 4RKfI8w67uwhXwRnspxPNNU/9a5AK3yskqU79K6/hB/ukdqRLpcJZdTlfsb6h6QKdJ3c a6VrQuzm3gEzUHbJqugRdMNufgxhfwrQsrKp8QTVxmp+CtySwygPTcGWqxBEJa9QqMDG 1Ke88SuE/idyBihywxmuYu1t3xOHIhEInjuWcGOKZq7CRdVPaJuoSCEdpT5rTdwqk1Fw WGSA==
MIME-Version: 1.0
X-Received: by 10.180.107.71 with SMTP id ha7mr8684399wib.28.1373178344404; Sat, 06 Jul 2013 23:25:44 -0700 (PDT)
Received: by 10.216.152.73 with HTTP; Sat, 6 Jul 2013 23:25:44 -0700 (PDT)
In-Reply-To: <CAHBU6iuWLcXv0QKR=Ow8gkzoZLmoZjqYCqXDXR8FLVb7w7M2Tw@mail.gmail.com>
References: <B86E1D4B-1DC8-4AD6-B8B3-E989599E0537@vpnc.org> <CAK3OfOj3MNNhjwo2bMa5CgoqynzMRVvviBXC8szxt5D17Z7FDg@mail.gmail.com> <51D3C63C.5030703@cisco.com> <51D48023.1020008@qti.qualcomm.com> <20130703201143.GL32044@mercury.ccil.org> <00cd01ce7a9f$19adeaa0$4d09bfe0$@augustcellars.com> <00d701ce7aa6$cc5fe700$651fb500$@augustcellars.com> <CAK3OfOiWrWCvNQneokyycV1Jb98M=UR-U7z0dhxUjzVdf+PwDw@mail.gmail.com> <CAHBU6itdi3B1rWv2TiOYhL1QuOVxrFKt7OTWRoG+6TgV8Bc_uw@mail.gmail.com> <CAK3OfOgOYA5fas0oomF5amjP1bR5F=0+uve7mFD4=FMoEV7sWg@mail.gmail.com> <CAGrxA24y4D62XY-YnbDvKVwNKUickcEFxv1FUhc_yqG4KP-m-w@mail.gmail.com> <CAHBU6iuWLcXv0QKR=Ow8gkzoZLmoZjqYCqXDXR8FLVb7w7M2Tw@mail.gmail.com>
Date: Sun, 7 Jul 2013 01:25:44 -0500
Message-ID: <CAK3OfOic41TWGhVJFwv1o64GarZhM0mqoF1TBruJ9OkCQbqijA@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: Jim Schaad <ietf@augustcellars.com>, Tatu Saloranta <tsaloranta@gmail.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Proposed minimal change for duplicate names in objects
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 07 Jul 2013 06:25:52 -0000

On Sat, Jul 6, 2013 at 11:58 PM, Tim Bray <tbray@textuality.com> wrote:
> I’ll assume you’re right when you say dupe detection has been measured as
> expensive at run time, but I’m thinking that if I were writing a reader I'd
> implement a hash table with a test-and-set method, so I admit I'm surprised
> by the finding.  I think I’d need to see a little more research before I’d
> accept that as a given.  -T

Dunno about Tatu, but I think the vast majority of JSON usage must be
coupled either with generic hash tables (objects/dicts/maps/whatever)
or structs (with associated schema).  For the latter dup detection may
well be more expensive than not, but probably not that much more
expensive.  For the former dup detection is essentially free.

For other use cases, like Stephen Dolan's "launch missiles" example,
dup detection might well be expensive, but maybe JSON is the wrong
tool for those use cases.

The CPU cost of dup detection doesn't concern me.  It's the
architectural implication that does: minimal state streaming parsers
are out.

I have to ask myself: are there use cases where I would want a minimal
state streaming parser?  and do I mind losing the ability to have such
a thing?  My personal, tentative answers: "yes" and "probably not,
maybe in such a case I should not use JSON".  Others will no doubt
have different answers, which brings us to...

...more retreading.

I still think the best thing to do is note the divergent
interpretations and publish Internet JSON.

Nico
--