unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31138: Native json slower than json.el
@ 2018-04-12 19:13 Sebastien Chapuis
  2018-04-13  7:24 ` Eli Zaretskii
  2019-04-22 18:20 ` Alex Gramiak
  0 siblings, 2 replies; 161+ messages in thread
From: Sebastien Chapuis @ 2018-04-12 19:13 UTC (permalink / raw)
  To: 31138

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]


Hi,

I have tested the new function json-parse-string to use it in lsp-mode
and was suprised when I found out that this function is slower than
json-read-from-string from json.el:

Test with a string of 4042446 characters:
```
json-parse-string:       9,166010 seconds
json-read-from-string:   6.028625 seconds
```

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 ? Should I set some variable to avoid
this ?


By the way, what is the state of this patch:
https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00916.html
Could it be merge ?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 534 bytes --]

diff --git a/src/json.c b/src/json.c
index b046d34f66..1fc976214d 100644
--- a/src/json.c
+++ b/src/json.c
@@ -219,8 +219,7 @@ json_has_suffix (const char *string, const char *suffix)
 static Lisp_Object
 json_make_string (const char *data, ptrdiff_t size)
 {
-  return code_convert_string (make_specified_string (data, -1, size, false),
-                              Qutf_8_unix, Qt, false, true, true);
+  return make_specified_string (data, -1, size, false);
 }
 
 /* Create a multibyte Lisp string from the null-terminated UTF-8

[-- Attachment #3: Type: text/plain, Size: 22 bytes --]


--
Sebastien Chapuis

^ permalink raw reply related	[flat|nested] 161+ messages in thread

end of thread, other threads:[~2020-08-23  5:50 UTC | newest]

Thread overview: 161+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-12 19:13 bug#31138: Native json slower than json.el Sebastien Chapuis
2018-04-13  7:24 ` Eli Zaretskii
2018-04-15 14:40   ` Sebastien Chapuis
2018-04-15 15:19     ` Eli Zaretskii
2019-03-23  1:59       ` Sébastien Chapuis
2019-03-23  8:15         ` Eli Zaretskii
2019-03-23  9:40           ` Eli Zaretskii
2019-03-23 12:59             ` Sébastien Chapuis
2019-03-23 13:21               ` Eli Zaretskii
2019-03-23 13:31                 ` yyoncho
2019-03-23 14:00                   ` Eli Zaretskii
2019-03-23 14:32                     ` yyoncho
2019-03-23 14:55                       ` Eli Zaretskii
2019-03-23 15:27                         ` yyoncho
2019-03-23 16:29                           ` Eli Zaretskii
     [not found]                             ` <CACCVLQW=_YngoTwXU+1BDvVVy5jwxSmDFUQJBvs8=PrP=fn=aw@mail.gmail.com>
2019-03-23 18:50                               ` Eli Zaretskii
2019-03-23 20:23                                 ` yyoncho
2019-03-23 20:54                                   ` Eli Zaretskii
2019-03-23 21:04                                     ` yyoncho
2019-03-24  3:32                                       ` Eli Zaretskii
2019-03-24  9:35                                         ` yyoncho
2019-03-24 11:20                                           ` Eli Zaretskii
2019-03-24 11:37                                             ` yyoncho
2019-03-24 15:15                                               ` Eli Zaretskii
2019-03-24 18:24                                                 ` yyoncho
2019-03-24 18:28                                                   ` Eli Zaretskii
2019-03-24 20:57                                                     ` yyoncho
2019-03-25  3:32                                                       ` Eli Zaretskii
2019-03-25  5:44                                                         ` yyoncho
2019-03-25 16:42                                                           ` Eli Zaretskii
2019-03-25 18:20                                                             ` yyoncho
2019-03-25 18:25                                                               ` Eli Zaretskii
2019-03-25 19:16                                                                 ` yyoncho
2019-03-25 20:05                                                                   ` Eli Zaretskii
2019-03-25 21:34                                                                     ` yyoncho
2019-03-25 23:04                                                                       ` Dmitry Gutov
2019-03-26  3:51                                                                       ` Eli Zaretskii
2019-03-26 16:14                                                                       ` Eli Zaretskii
2019-03-26 17:45                                                                         ` yyoncho
2019-03-26 18:11                                                                           ` Eli Zaretskii
2019-03-26 18:15                                                                             ` yyoncho
2019-04-16  1:36                                                                         ` Dmitry Gutov
2019-04-16  2:38                                                                           ` Eli Zaretskii
2019-04-16 13:50                                                                             ` Dmitry Gutov
2019-04-16 15:13                                                                               ` Eli Zaretskii
2019-04-16 15:30                                                                                 ` Dmitry Gutov
2019-04-16 16:10                                                                                   ` Eli Zaretskii
2019-04-16 16:23                                                                                     ` Dmitry Gutov
2019-04-16 16:44                                                                                       ` Eli Zaretskii
2019-04-21  8:58                                                                                         ` Eli Zaretskii
2019-04-21  9:15                                                                                           ` Dmitry Gutov
2019-04-21  9:31                                                                                             ` Eli Zaretskii
2019-04-21 10:23                                                                                               ` yyoncho
2019-04-21 10:37                                                                                                 ` Eli Zaretskii
2019-04-21 11:38                                                                                                   ` yyoncho
2019-04-21 12:15                                                                                                     ` Eli Zaretskii
2019-04-21 13:28                                                                                                       ` yyoncho
2019-04-21 19:03                                                                                                         ` Eli Zaretskii
2019-04-21 20:13                                                                                                           ` Eli Zaretskii
2019-04-22  5:38                                                                                                           ` yyoncho
2019-04-22  8:01                                                                                                             ` Eli Zaretskii
2019-04-22 13:00                                                                                                               ` yyoncho
2019-04-22 13:17                                                                                                                 ` Eli Zaretskii
2019-04-22 16:53                                                                                                                   ` Ivan
2019-04-22 16:58                                                                                                                     ` Eli Zaretskii
2019-04-21 22:17                                                                                                       ` Dmitry Gutov
2019-04-22  7:16                                                                                                         ` Eli Zaretskii
2019-04-22 13:54                                                                                                           ` Dmitry Gutov
2019-04-22 15:24                                                                                                             ` Eli Zaretskii
2019-04-22 15:31                                                                                                               ` Dmitry Gutov
2019-04-21 12:59                                                                                                 ` Philipp Stephani
2019-04-21 13:09                                                                                                   ` yyoncho
2019-04-21 13:33                                                                                                     ` Philipp Stephani
2019-04-22 11:48                                                                                                       ` Dmitry Gutov
2019-04-22 12:12                                                                                                         ` Eli Zaretskii
2019-04-22 12:24                                                                                                           ` Dmitry Gutov
2019-04-22 13:02                                                                                                             ` Eli Zaretskii
2019-04-22 15:02                                                                                                               ` Dmitry Gutov
2019-04-22 15:36                                                                                                                 ` Eli Zaretskii
2019-04-22 16:16                                                                                                                   ` Dmitry Gutov
2019-04-22 16:28                                                                                                                     ` Eli Zaretskii
2019-04-22 16:44                                                                                                                       ` Dmitry Gutov
2019-04-22 16:50                                                                                                                         ` Eli Zaretskii
2019-04-22 17:05                                                                                                                       ` Dmitry Gutov
2019-04-22 17:24                                                                                                                         ` Eli Zaretskii
2019-04-22 21:03                                                                                                                           ` Dmitry Gutov
2019-04-23 10:22                                                                                                                             ` Eli Zaretskii
2019-04-23 11:39                                                                                                                               ` Dmitry Gutov
2019-04-23 13:19                                                                                                                                 ` Eli Zaretskii
2019-04-22 16:49                                                                                                                     ` Eli Zaretskii
2019-04-22 17:11                                                                                                                       ` Dmitry Gutov
2019-04-22 17:26                                                                                                                         ` Eli Zaretskii
2019-04-22 22:23                                                                                                                           ` Dmitry Gutov
2019-04-23  6:00                                                                                                                             ` Eli Zaretskii
2019-04-23  9:46                                                                                                                               ` Philipp Stephani
2019-04-23 10:38                                                                                                                                 ` Eli Zaretskii
2019-04-23 10:44                                                                                                                                   ` Dmitry Gutov
2019-04-24  2:23                                                                                                                               ` Richard Stallman
2019-04-22 17:12                                                                                                                       ` Eli Zaretskii
2019-04-22 21:00                                                                                                                         ` Dmitry Gutov
2019-04-21 22:14                                                                                                 ` Dmitry Gutov
2019-04-22  7:06                                                                                                   ` Eli Zaretskii
2019-04-21 22:12                                                                                               ` Dmitry Gutov
2019-04-22  7:03                                                                                                 ` Eli Zaretskii
2019-04-22 11:46                                                                                                   ` Dmitry Gutov
2019-04-22 12:07                                                                                                     ` Eli Zaretskii
2019-04-22 12:58                                                                                                       ` Dmitry Gutov
2019-04-22 13:12                                                                                                         ` Eli Zaretskii
2019-04-22 13:58                                                                                                           ` Dmitry Gutov
2019-04-22 15:25                                                                                                             ` Eli Zaretskii
2019-04-22 15:41                                                                                                               ` Dmitry Gutov
2019-04-22 15:50                                                                                                                 ` Eli Zaretskii
2019-04-22 16:00                                                                                                                   ` Dmitry Gutov
2019-04-22 16:22                                                                                                                     ` Eli Zaretskii
2019-04-22 19:55                                                                                                                       ` Dmitry Gutov
2019-04-22 20:28                                                                                                                         ` Eli Zaretskii
2019-04-23 11:52                                                                                                                           ` Dmitry Gutov
2019-04-23 12:15                                                                                                                             ` Eli Zaretskii
2019-04-23 12:37                                                                                                                               ` yyoncho
2019-04-23 13:09                                                                                                                                 ` Eli Zaretskii
2019-04-23 13:27                                                                                                                                   ` yyoncho
2019-04-23 14:24                                                                                                                                     ` Eli Zaretskii
2019-04-23 12:37                                                                                                                               ` Sébastien Chapuis
2019-04-23 13:10                                                                                                                                 ` Eli Zaretskii
2019-04-23 14:22                                                                                                                               ` Dmitry Gutov
2019-04-23 14:40                                                                                                                                 ` Philipp Stephani
2019-04-23 15:09                                                                                                                                   ` Eli Zaretskii
2019-04-23 15:17                                                                                                                                     ` Eli Zaretskii
2019-04-23 15:36                                                                                                                                     ` yyoncho
2019-04-23 15:39                                                                                                                                       ` Eli Zaretskii
2019-04-23 15:43                                                                                                                                         ` yyoncho
2019-04-23 22:34                                                                                                                                     ` Dmitry Gutov
2019-04-24  6:20                                                                                                                                       ` Eli Zaretskii
2019-04-24  6:57                                                                                                                                         ` Dmitry Gutov
2019-04-24  7:28                                                                                                                                           ` Eli Zaretskii
2019-04-24  9:52                                                                                                                                             ` Dmitry Gutov
2019-04-23 14:58                                                                                                                                 ` Eli Zaretskii
2019-04-24 15:55                                                                                                                                   ` Dmitry Gutov
2019-04-24 16:21                                                                                                                                     ` Eli Zaretskii
2019-04-24 16:46                                                                                                                                       ` Dmitry Gutov
2019-04-24 17:06                                                                                                                                         ` Eli Zaretskii
2019-04-24 17:36                                                                                                                                           ` Dmitry Gutov
2019-04-24 17:43                                                                                                                                             ` Eli Zaretskii
2019-04-24 20:25                                                                                                                                               ` Dmitry Gutov
2019-04-25 10:44                                                                                                                                                 ` Eli Zaretskii
2019-04-25 14:27                                                                                                                                                   ` Dmitry Gutov
2020-08-22 23:28                                                                                                                                                     ` Lars Ingebrigtsen
2020-08-23  5:50                                                                                                                                                       ` Eli Zaretskii
2019-04-23 14:50                                                                                                                               ` Andy Moreton
2019-04-23 15:03                                                                                                                                 ` Eli Zaretskii
2019-04-23 15:44                                                                                                                                   ` Andy Moreton
2019-04-22 11:36                                                                                                 ` Dmitry Gutov
2019-04-22 12:01                                                                                                   ` Eli Zaretskii
2019-04-22 13:11                                                                                                     ` Dmitry Gutov
2019-03-30  9:07                                                               ` Eli Zaretskii
2019-04-22 18:20 ` Alex Gramiak
2019-04-22 18:27   ` Eli Zaretskii
2019-04-22 19:52     ` Alex Gramiak
2019-04-22 20:05       ` Dmitry Gutov
2019-04-23  3:06         ` Alex Gramiak
2019-04-23 11:44           ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).