|
From: | Dmitry Gutov |
Subject: | bug#31138: Native json slower than json.el |
Date: | Wed, 24 Apr 2019 01:34:37 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 23.04.2019 18:09, Eli Zaretskii wrote:
If we want to make this more general-purpose, we should time the code with very long strings. It could be that beyond some length the UTF-8 verification, if it fails, will make the conversion slower, in which case we probably should not take the shortcut beyond that length limit.
If it fails, yes. Although it might still be an insignificant fraction of the total time it takes (verification is O(N), and conversion is O(N) as well).
Or we might document that non-UTF-8 strings will be slower to convert, if that's acceptable.
*Invalid* UTF-8 strings. Strings that aren't actually UTF-8, even though the caller declares them to be.
I think this can be a good (and simple) tradeoff.
[Prev in Thread] | Current Thread | [Next in Thread] |