GNU bug report logs - #46761
28.0.50; Speed up json.el encoding

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Thu, 25 Feb 2021 01:35:01 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Speed up json.el encoding
Date: Thu, 25 Feb 2021 01:33:47 +0000
[Message part 1 (text/plain, inline)]
Severity: wishlist
Tags: patch

The attached patch speeds up json-encode by inserting into a buffer
rather than concatenating strings.  It does so backward compatibly by
creating a new json--print-* namespace that mirrors the existing
json-encode-* namespace, cleaning it up a bit and reducing code
duplication in the process.

Using my usual benchmark from bug#40693#89:

  canada.json
  old (1.412693239 96 0.736882091)
  new (1.154423962 32 0.248241551)

  citm_catalog.json
  old (0.676292855 68 0.5285956769999993)
  new (0.306573098 12 0.0965493740000003)

  twitter.json
  old (0.353447016 40 0.28536439900000055)
  new (0.142140227  8 0.05943713899999992)

Note that one of the unit tests depends on the patch to map.el in
bug#46754 in order to pass.

WDYT?

Thanks,

-- 
Basil

[0001-Speed-up-json.el-encoding.patch (text/x-diff, attachment)]

This bug report was last modified 4 years and 73 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.