emacs-devel
[Top][All Lists]
Advanced

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

Re: String encoding in json.c


From: Philipp Stephani
Subject: Re: String encoding in json.c
Date: Tue, 26 Dec 2017 21:50:33 +0000



Eli Zaretskii <address@hidden> schrieb am Di., 26. Dez. 2017 um 05:35 Uhr:

> I'm not sure which encoding speeds json.c allows us now.

Well, Philipp measured it, so maybe he could share the benchmarks and
the results.

json.el itself got some speedups from the time of that bug report, as Dmitry mentioned in the bug.
My benchmark is a relatively dumb microbenchmark that calls the JSON functions 20 times on the data files in nativejson-benchmark. Then I ran that code through the `bench' program, which does some basic statistical analysis. Serialization is in all cases more than 5 times faster, with a high significance.
 

> But the JSON structure I was talking about is not written to a file.
> It's sent over the network (usually to a local TCP socket).

In that case, encoding it is not a wasted effort, since it would have
been otherwise encoded when we send it.

If that turns out to be a problem, we might consider returning a unibyte string to avoid further encoding. 

reply via email to

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