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: Fri, 13 Apr 2018 10:24:57 +0300

> From: Sebastien Chapuis <address@hidden>
> Date: Thu, 12 Apr 2018 21:13:41 +0200
> 
> I took a look at the code, and if I remove the call to
> code_convert_string in json_make_string (see the attached diff),
> it's way faster:
> 
> Test with a string of 4042411 characters
> ```
> json-parse-string (without code_convert_string):
> 0.505582 seconds
> ```
> 
> Is this conversion really necessary ?

Yes, it's necessary, because the input string may include raw bytes,
which will crash Emacs if not handled properly.

I'm surprised that the slowdown due to the conversion is so large,
though.  It doesn't feel right, even with a 4MB string.





reply via email to

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