Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings

From: Dmitry Gutov <[email-masked]>
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).