GNU bug report logs - #20154
25.0.50; json-encode-string is too slow for large strings

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Fri, 20 Mar 2015 14:27:01 UTC

Severity: normal

Found in version 25.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20154 <at> debbugs.gnu.org
Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings
Date: Fri, 20 Mar 2015 18:44:35 +0200
> Date: Fri, 20 Mar 2015 18:21:46 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> CC: 20154 <at> debbugs.gnu.org
> 
> > I suggest to rewrite json-encode-char, it does a lot of unnecessary
> > stuff, starting with the call to encode-char (which was needed in
> > Emacs 22 and before, but no more).  The call to rassoc is also
> > redundant, since you already have that covered in your regexp.
> 
> Yes, I thought about that, but as the number of calls to 
> `json-encode-char' must have decreased by 10 in the new version (only 
> each 10th character needs to be encoded), and the runtime only decreased 
> by 3 (or by 2, in a different example I have), the total improvement 
> can't be dramatic enough even if `json-encode-char' is lightning-fast.

To see how much of the time is taken by json-encode-char, replace it
with something trivial, like 1+, and see what speedup you get.




This bug report was last modified 10 years and 38 days ago.

Previous Next


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