emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JSON/YAML/TOML/etc. parsing performance


From: Philipp Stephani
Subject: Re: JSON/YAML/TOML/etc. parsing performance
Date: Sun, 17 Sep 2017 20:27:02 +0000



Eli Zaretskii <address@hidden> schrieb am So., 17. Sep. 2017 um 21:05 Uhr:
> From: Philipp Stephani <address@hidden>
> 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
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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]