[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#31138: Native json slower than json.el

From: Dmitry Gutov
Subject: bug#31138: Native json slower than json.el
Date: Thu, 25 Apr 2019 17:27:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 25.04.2019 13:44, Eli Zaretskii wrote:

Why faster?

Because the library will perform its validation anyway, during normal

But if we validate the string before even calling the library, that
will be even faster, no?

Only if the string is invalid. There's not much point in optimizing for that situation, I think.

Any extra validation work Emacs performs, will take time on
top of that (of course, I don't know how much time).

Didn't we just establish that it's almost negligible?  Especially for
short strings?

Probably. But I can't say for sure without seeing the code.

And more importantly, will the error indication be useful enough to
the Lisp program that triggered it?  If we signal an error, we can
make sure of that.

We still signal errors if the library returns an error code.

But we need to guess the reason.

I think I've addressed that in the part of the reply you cut out: "we also perform additional validation ourselves if something goes wrong". That can be extended, if you like.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]