unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* String encoding in json.c
@ 2017-12-23 14:26 Philipp Stephani
  2017-12-23 14:43 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Philipp Stephani @ 2017-12-23 14:26 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 941 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-12-27 16:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-23 14:26 String encoding in json.c Philipp Stephani
2017-12-23 14:43 ` Eli Zaretskii
2017-12-23 15:31   ` Philipp Stephani
2017-12-23 15:53     ` Eli Zaretskii
2017-12-23 17:27       ` Philipp Stephani
2017-12-23 18:18         ` Eli Zaretskii
2017-12-26 21:42           ` Philipp Stephani
2017-12-27 16:08             ` Eli Zaretskii
2017-12-24 20:48   ` Dmitry Gutov
2017-12-25 16:21     ` Eli Zaretskii
2017-12-25 20:51       ` Dmitry Gutov
2017-12-26  4:35         ` Eli Zaretskii
2017-12-26 21:50           ` Philipp Stephani
2017-12-27  2:00             ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).