emacs-devel
[Top][All Lists]
Advanced

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

String encoding in json.c


From: Philipp Stephani
Subject: String encoding in json.c
Date: Sat, 23 Dec 2017 14:26:09 +0000

Hi,

I've benchmarked serialization and parsing of JSON with and without explicit encoding. I've found that leaving out the coding makes both operations significantly faster – from a speedup of a factor of 1.11 ± 0.06 for parsing canada.json to 1.57 ± 0.08 for serializing twitter.json. Other speedups are in between, but the speedup is always significant (to at least one standard deviation). All unit tests pass when leaving out the coding steps – which isn't surprising given that currently the coding operations are expensive no-ops. Therefore I'd suggest to document the internal string encoding in lisp.h or character.h and remove the explicit coding in json.c and emacs-module.c. It's very unlikely that the internal string encoding will change frequently, and if so, the unit tests should catch potential issues caused by that.

Philipp

reply via email to

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