bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31138: Native json slower than json.el


From: Eli Zaretskii
Subject: bug#31138: Native json slower than json.el
Date: Mon, 22 Apr 2019 16:02:49 +0300

> Cc: address@hidden, address@hidden, address@hidden,
>  address@hidden
> From: Dmitry Gutov <address@hidden>
> Date: Mon, 22 Apr 2019 15:24:24 +0300
> 
> Thank you. Tried it, tests now pass, and the performance improvement is 
> the same. I compared the same benchmark (100 iterations, GC disabled for 
> the whole duration), and this patch takes
> 
> src/emacs -Q --batch -l ~/examples/elisp/json-test.el
> Elapsed time: 51.153870s
> 
> down to
> 
> $ src/emacs -Q --batch -l ~/examples/elisp/json-test.el
> Elapsed time: 26.268435s
> 
> Are you still against it? (Just checking).

I'm still against using that patch as is, yes.  I'm okay with using
make_specified_string if before calling it we make sure the string is
plain ASCII or a series of proper UTF-8 sequences.  Not sure how much
of a performance hit would such tests cost us, but if you are
interested, let's time them.

(Let me know if you need help in writing the code for the above 2
tests.  I think parse_str_as_multibyte should help a lot.)

I guess we should also have some test case with non-ASCII characters,
if we will introduce these optimizations.

Thanks.

P.S.  I'm still not sure these optimizations will make the OP happy,
since at some point I heard them saying that our present performance
is abysmally slow and inadequate.  If that wasn't a wild exaggeration,
then halving the time will still be inadequate.  So maybe we should
agree in advance whether 30% to 50% improvement will be "good enough",
before we embark on this adventure.





reply via email to

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