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 15:12:48 +0300

> Cc: Eli Zaretskii <eliz@gnu.org>, Sébastien Chapuis
>  <sebastien@chapu.is>, 31138@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Mon, 22 Apr 2019 14:48:52 +0300
> 
> If I simply apply the patch from 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31138#5, that breaks tests 
> in test/src/json-tests.el. In particular, json-parse-string/string:
> 
> F json-parse-string/string
>      (ert-test-failed
>       ((should
>         (equal
>          (json-parse-string "[\"abcαβγ\"]")
>          ["abcαβγ"]))
>        :form
>        (equal
>         ["abc\316\261\316\262\316\263"]
>         ["abcαβγ"])
>        :value nil :explanation
>        (array-elt 0
>                   (arrays-of-different-length 9 6 
> "abc\316\261\316\262\316\263" "abcαβγ" first-mismatch-at 3))))

That patch causes us to create unibyte strings, so it's small wonder
you see these failures.

> Would somebody like to propose an alternative patch?

Try using 'true' as the last argument of make_specified_string.





reply via email to

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