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: Dmitry Gutov <dgutov <at> yandex.ru>
To: 20154 <at> debbugs.gnu.org
Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings
Date: Sun, 22 Mar 2015 18:47:24 +0200
On 03/22/2015 06:15 PM, Ivan Shmakov wrote:

> 	Why not ‘let’ mb above and use (while (setq mb (string-match …))
> 	…) here (instead of going through match-beginning)?

Good point, thanks. It wins a few milliseconds.

> 	Is there a specific reason to prefer rassoc over rassq here?

Not at all. Good call, though no performance improvement.

>   >     (push (substring string start l) res)
>   >     (push "\"" res)
>   >     (apply #'concat (nreverse res))))
>
> 	I guess you can (apply #'concat "\"" (substring …) (nreverse …))
> 	just as well, instead of pushing to the list just before getting
> 	rid of it.

Also good idea, but partially. That gets rid of the initial binding for 
`res', but those (substring ...) value and quote have to go to the end 
of the string. We can't put them as the last arguments to `apply'.

>   > Please keep the discussion participants in Cc, even if you prefer not
>   > to receive the copy email.
>
> 	Curiously, per my experience, the practice of Cc:-ing the
> 	subscribers tends to be frowned upon when it comes to the lists
> 	dedicated to free software.  For the reasons I do not know or
> 	understand, Emacs lists are apparently an exception, though.

To the best of my knowledge, debbugs only sends a copy to the bug's 
author, and there's no way to subscribe. So that excludes Eli (although 
he probably subscribes to all bugs anyway).




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.