Re: [jose] Performance of Canonical JSON

Tim Bray <tbray@textuality.com> Sun, 09 December 2018 18:19 UTC

Return-Path: <tbray@textuality.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EFC44128AFB for <jose@ietfa.amsl.com>; Sun, 9 Dec 2018 10:19:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.358
X-Spam-Level:
X-Spam-Status: No, score=-3.358 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-1.459, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=textuality-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hMojAF6HlZJB for <jose@ietfa.amsl.com>; Sun, 9 Dec 2018 10:19:28 -0800 (PST)
Received: from mail-it1-x129.google.com (mail-it1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6F7EA1276D0 for <jose@ietf.org>; Sun, 9 Dec 2018 10:19:28 -0800 (PST)
Received: by mail-it1-x129.google.com with SMTP id o19so14177553itg.5 for <jose@ietf.org>; Sun, 09 Dec 2018 10:19:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=textuality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6PVFg5WRDmamhmYKyA9tb85rqksUu81U4/6diuDhirE=; b=0zIwNQ2jw/SXwzDcJkg9AJOEOO0kgJ1Kp7ke5eVZ2N1cYwmiof9MkAvsIOl/gMzq/l TEijtnDkgvCtL+VdRovVlgkBonmcBiLQpMHbnSo8HNPragbHLXkIPLPCG/YLKzbsICSa noJNTykBdsw+75G9MHkFimt2VU6mqpM0BxHgjp2lgUePc64RM7/jMynNKspxnHfxkC10 7orycVPlt/FoVLyHuwZzwm70onG8nvJ8Wr7SNSUNcZv8VGT4BTayZ17aDDZt+dSxlPo3 kRZ150Q5Q6Mz7rT9KO38Q8M2KF5+ELu7EZpJqYRnR0snSekVZx6parWzmeGuLUeP5yKg +n3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6PVFg5WRDmamhmYKyA9tb85rqksUu81U4/6diuDhirE=; b=aY7nZBjrJucJ6dJJ1gUtHHPJtZ9VWM0fN38pNH8lvG6lY2VVBmw0ee2zdX74j/6c4c u8cG1hclcMZOkoxJsAo3fVjTj51qnSPmaK2p253bKnil0fWUxm1ZmPC1ZgL09UDVyYDT hKmTJU/Q8Gk2Zm7X+CXxSTR2lucYupQta/cLcrqz3ofQD91fKoNUef6WV1parknSXU9K bwze1DA2U+RzVrfvzMlpw8RWAh0BAL1DuFKkbPwP2+1rk2dw50PE0zS5l49TTL1suDDk IzoNOemKQHoLdFqb8CyE0YID61CVYSpzW1ilDEUtHRskNb6C+4cKoxFOGJ3g5ahbX3rZ PRHw==
X-Gm-Message-State: AA+aEWaLMquvyJfBwivVSxD9CT7l5AkD0hfW45yuFz7Uar59fzq3Xk0I wSukfFliiYEmqM07wdLtwLlcNaYN0Ekwy+KdsazHfg==
X-Google-Smtp-Source: AFSGD/WoCK2NnRZKhm1p8crC0JgwLNQpkCbMx6aLCiadoAOubETLkgakuxhj07tj7pAmrLbZJw1TLv7VtgVrjfknljo=
X-Received: by 2002:a24:4293:: with SMTP id i141mr8028698itb.5.1544379567683; Sun, 09 Dec 2018 10:19:27 -0800 (PST)
MIME-Version: 1.0
References: <3466a48c-115d-3810-4c94-0e213ba407fd@gmail.com> <3386D76C-D8FA-43CA-9B4A-B171C6B61267@gmail.com> <2121e4c8-2abd-4478-98b6-a2b3a7029bbc@gmail.com>
In-Reply-To: <2121e4c8-2abd-4478-98b6-a2b3a7029bbc@gmail.com>
From: Tim Bray <tbray@textuality.com>
Date: Sun, 9 Dec 2018 10:19:16 -0800
Message-ID: <CAHBU6ivMa_hwdFudzywKbGK2AP1-O+1+r=eG0o9gtqmEVEkzXw@mail.gmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>, Carsten Bormann <cabo@tzi.org>
Cc: Bret Jordan <jordan.ietf@gmail.com>, jose <jose@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000087c006057c9ae3a5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/-zFeWUdvjQ07pv7hNmK7h59LAn4>
Subject: Re: [jose] Performance of Canonical JSON
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 09 Dec 2018 18:19:31 -0000

Without addressing the rest of the question, your assertion that a
hypothetical JSON working group approach to c14n would take a schema-driven
approach is unsupported by evidence and I think very unlikely.  If only
because there is no JSON schema technology that has anything like consensus
support.

On Sun, Dec 9, 2018 at 2:22 AM Anders Rundgren <
anders.rundgren.net@gmail.com> wrote:

> On 2018-12-07 19:25, Bret Jordan wrote:
> > Thanks for the test data. Are you going to request a side meeting for
> Prague?
>
> That's a good question. Since few have read the existing (somewhat
> constrained), serialization-only proposal [1], I'm considering other
> alternatives [4,5]
>
> As you know REST [2] is currently held as the only "real" way architecting
> Web applications.  In spite of that, there is no standard for signing REST
> requests but signed REST requests are still used in the wild including by
> Amazon [3].
>
> A rebooted JSON WG would likely settle on a full-fledged counterpart to
> XML's "CN14" which I have no interest in because it presumes that the
> canonicalization process is schema driven for both parsing and
> serialization, making deployment much more complex.
>
> Anyway, IF there actually is GENUINE interest in a BoF session in Prague,
> could you guys on the list indicate your interest?
>
> Thanx,
> Anders
>
> 1]
> https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-01
>
> 2] https://en.wikipedia.org/wiki/Representational_state_transfer
>
> 3]
> https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
>
> 4] https://www.rfc-editor.org/about/independent/
>
> 5] Ignoring the standards process and rather let associated applications
> like https://cyberphone.github.io/doc/two-visions-4-mobile-payments.pdf
> set a de-facto standard.
>
>
>
> >
> > Bret
> >
> > Sent from my Commodore 128D
> >
> > PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
> >
> > On Dec 7, 2018, at 9:23 AM, Anders Rundgren <
> anders.rundgren.net@gmail.com <mailto:anders.rundgren.net@gmail.com>>
> wrote:
> >
> >> Since XML Canonicalization has a reputation of not only being brittle
> but also terribly slow, I tested JCS [1] with the following JSON file:
> >> {
> >>   "1": {"f": {"f": "hi","F": 5} ,"\n": 56.0},
> >>   "10": { },
> >>   "": "empty",
> >>   "a": { },
> >>   "111": [ {"e": "yes","E": "no" } ],
> >>   "A": { }
> >> }
> >>
> >> Expected output:
> {"":"empty","1":{"\n":56,"f":{"F":5,"f":"hi"}},"10":{},"111":[{"E":"no","e":"yes"}],"A":{},"a":{}}
> >>
> >> Since JCS only is a serialization concept (parsing is unaffected), I
> compared the execution speed of standard serialization versus canonicalized
> serialization.
> >>
> >> Using https://www.npmjs.com/package/canonicalize the performance
> penalty was about 2.4 compared to JSON.stringify().
> >> Using my homegrown JSON tools written in Java having an integrated
> "canonicalize" serializer option the performance penalty was about 1.4
> >>
> >> Anders
> >>
> >> 1]
> https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-01
> >>
> >> _______________________________________________
> >> jose mailing list
> >> jose@ietf.org <mailto:jose@ietf.org>
> >> https://www.ietf.org/mailman/listinfo/jose
>
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose
>


-- 
- Tim Bray (If you’d like to send me a private message, see
https://keybase.io/timbray)