|
From: | Dmitry Gutov |
Subject: | bug#20154: 25.0.50; json-encode-string is too slow for large strings |
Date: | Fri, 20 Mar 2015 18:21:46 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 |
On 03/20/2015 06:02 PM, Eli Zaretskii wrote:
I have other things on my plate while I read email. If my advice bothers you, I can shut up in the future.
Very well. Please continue with the advice.
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.
[Prev in Thread] | Current Thread | [Next in Thread] |