From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: Re: JSON/YAML/TOML/etc. parsing performance Date: Sun, 17 Sep 2017 18:41:01 -0400 Message-ID: <87zi9tdk3m.fsf@udel.edu> References: <87poaqhc63.fsf@lifelogs.com> <83vakhi1rx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1505688095 31221 195.159.176.226 (17 Sep 2017 22:41:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Sep 2017 22:41:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 18 00:41:19 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtiFa-0007W2-N6 for ged-emacs-devel@m.gmane.org; Mon, 18 Sep 2017 00:41:18 +0200 Original-Received: from localhost ([::1]:33876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtiFh-0002Uy-V8 for ged-emacs-devel@m.gmane.org; Sun, 17 Sep 2017 18:41:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtiFR-0002U8-J8 for emacs-devel@gnu.org; Sun, 17 Sep 2017 18:41:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtiFM-0006aI-Ug for emacs-devel@gnu.org; Sun, 17 Sep 2017 18:41:09 -0400 Original-Received: from mail-qt0-x233.google.com ([2607:f8b0:400d:c0d::233]:46464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtiFM-0006Zx-PE for emacs-devel@gnu.org; Sun, 17 Sep 2017 18:41:04 -0400 Original-Received: by mail-qt0-x233.google.com with SMTP id s18so6056568qta.3 for ; Sun, 17 Sep 2017 15:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zgFk3eAgQt8HStMSuCR6vgeJ/MBfYqHqQFAC2ygrCZA=; b=W92Wo16SCBFWWt+Cqj2a/GBClk2jYTaswxfqEOD14ECDk887w2tl5QF8v+ogrCLiCB K/xP3Y2u4gKphLxcnq/Rllt1vvJ7gOX1Yv5pZj0+jCO+CWczUhXhZKphsXlZjklkCJcY BgPxBfMNmiEWtX63HJlOg9OCc5k1X0g/fvN7N7TyflrSqQB5n50X/sumGF9Kr2QffOMj p4N6mCDzaYdhUYWCn+sX/io1ACIE3W5T0EnSW40ObHcDiNvDAQN6bBfp73TlaoXkMcDQ 5BvRj6DcVvO1mtFOqXX9zGHFedXLtaTtvsw9O5YLl6OsfPOPk2IBef20YshoHa3U9929 xKlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zgFk3eAgQt8HStMSuCR6vgeJ/MBfYqHqQFAC2ygrCZA=; b=smuR4fx8s+UUsoILjJvXyb3HyGtMcW5c/axTffiBbIrMwKxVK1vwrFIc/E4dBXUI+b pVuRqZuhNnUlaOQa1wssx/wPUKwlllsn/+0qJcANOvKkvc8gSQX29lNqDZD3SGgbGXst 8h0p9NN0oKv4w1iiKJG528SSwPNu1RCFRZLrzQszI9yz9+oNutWk+g75Uqwn4uqWJuHS M5o/8GGDdpKewHmI7/i6f3vh8xa3ZkAFkuaYNEnsoqnhchYLiMTa5KNoMH3b3iquInb4 bg2T6e+XWf/XF3FMErAt/4JzphFDR3EhMqtQgfnSLkVDmesoy7zz/Ob58e/objFWRqOn wygQ== X-Gm-Message-State: AHPjjUg8sgGgXLtDEUJ61Jh9Wl76hGyjJz7mabn9t0+Q31K5i5FWwpaX pVzjq/V7Z+LP0Isk X-Google-Smtp-Source: AOwi7QDI5ki/AOmzIdsc/Pl/F6UaJMx/Hih8IXmF9xTG+HRA2mdK986ipZgGTTXhmwKxZr4ouEsJmQ== X-Received: by 10.200.23.140 with SMTP id o12mr32606041qtj.269.1505688063572; Sun, 17 Sep 2017 15:41:03 -0700 (PDT) Original-Received: from holos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id z187sm4108216qke.0.2017.09.17.15.41.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 15:41:02 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id C7BB169594; Sun, 17 Sep 2017 18:41:01 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Sun, 17 Sep 2017 20:27:02 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218438 Archived-At: Philipp Stephani writes: > Eli Zaretskii schrieb am So., 17. Sep. 2017 um 21:05 Uhr: > > > From: Philipp Stephani > > Date: Sun, 17 Sep 2017 18:46:45 +0000 > > > > I don't know much about the others, but given the importance of JSON as data exchange and serialization > > format, I think it's worthwhile to invest some time here. I've implemented a wrapper around the json-c library > > (license: Expat/X11/MIT), resulting in significant speedups using the test data from > > https://github.com/miloyip/nativejson-benchmark: a factor of 3.9 to 6.4 for parsing, and a factor of 27 to 67 for > > serializing. If people agree that this is useful I can send a patch. > > Before we make a decision on which library to use, I'd prefer some > kind of survey of available free software libraries, including their > popularity and development activity. The survey doesn't have to be > exhaustive, but I think we should compare at least a few candidates. > We already have 2, so maybe we should start by comparing them. > > Sure, I've made a quick overview based on > https://github.com/miloyip/nativejson-benchmark. I've only used the > libraries that are written in C and have been tested in that > benchmark; it's still quite a few. I've checked the conformance and > speed metrics from the benchmark as well as number of GitHub stars (as > proxy for popularity) and number of commit in the last month (as proxy > for development activity): Here are the results: > https://docs.google.com/spreadsheets/d/e/2PACX-1vTqKxqo47s67L3EJ9AWvZclNuT2xbd9rgoRuJ_UYbXgnV171owr8h2mksHjrjNGADDR3DVTWQvUMBpe/pubhtml?gid=0&single=true Thanks for coming up with these comparisons. > Note that some of the libraries (jsmn, ujson4c) don't appear to > support serialization at all; I'd suggest to avoid them, because we'd > then need to wrap another library for serialization. Also, even though > JSMN advertises itself as "world's fastest JSON parser", it's actually > the slowest of the libraries in the survey. json-c appears to be > reasonably conformant and fast for both parsing and serialization, and > has by far the largest development activity. I was a little confused how they got a "parsing" benchmark out of jsmn, since all it does is tokenize. No matter, it makes sense pursue something that does both.