From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: sebastien@chapu.is, yyoncho@gmail.com, 31138@debbugs.gnu.org
Subject: bug#31138: Native json slower than json.el
Date: Tue, 16 Apr 2019 16:50:58 +0300 [thread overview]
Message-ID: <21f68973-a684-2a65-82eb-c8f3df90127f@yandex.ru> (raw)
In-Reply-To: <83r2a2hdxn.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 487 bytes --]
On 16.04.2019 5:38, Eli Zaretskii wrote:
>> So what should we profile? The internals of code_convert_string?
>
> The entire run of parsing a large JSON. code_convert_string will be
> part of the profile.
All right, my test script and results are attached. Here's how I run it:
sudo perf record -F 99 src/emacs -Q --batch -l ~/examples/elisp/json-test.el
sudo perf report -n --stdio > perf-report.txt
If you have certain recording or output format preferences, please let
me know.
[-- Attachment #2: json-test.el --]
[-- Type: text/x-emacs-lisp, Size: 175 bytes --]
(defun test ()
(with-temp-buffer
(insert-file-contents "~/examples/sample-response.json")
(goto-char (point-min))
(json-parse-buffer)))
(benchmark 10 '(test))
[-- Attachment #3: perf-report.txt --]
[-- Type: text/plain, Size: 11068 bytes --]
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 443 of event 'cycles:ppp'
# Event count (approx.): 13387864690
#
# Overhead Samples Command Shared Object Symbol
# ........ ............ ....... .................... ................................
#
6.20% 27 emacs emacs [.] decode_coding_utf_8
4.67% 21 emacs libc-2.27.so [.] malloc_consolidate
4.31% 19 emacs libc-2.27.so [.] __memmove_avx_unaligned_erms
3.93% 17 emacs emacs [.] produce_chars
3.30% 15 emacs libc-2.27.so [.] malloc
3.25% 15 emacs libc-2.27.so [.] _int_malloc
2.95% 13 emacs emacs [.] store_symval_forwarding
2.78% 12 emacs libc-2.27.so [.] cfree@GLIBC_2.2.5
2.75% 12 emacs emacs [.] json_to_lisp
2.70% 1 emacs [kernel.kallsyms] [k] sync_regs
2.37% 12 emacs emacs [.] mark_object
2.08% 9 emacs emacs [.] set_buffer_internal_2
2.07% 9 emacs emacs [.] make_uninit_multibyte_string
2.06% 9 emacs emacs [.] swap_in_symval_forwarding
2.06% 9 emacs emacs [.] do_symval_forwarding
1.91% 10 emacs emacs [.] sweep_strings
1.55% 8 emacs emacs [.] detect_coding
1.44% 1 emacs [kernel.kallsyms] [k] error_entry
1.36% 7 emacs emacs [.] detect_coding_utf_8
1.36% 6 emacs emacs [.] hash_lookup
1.34% 7 emacs emacs [.] boyer_moore
1.16% 5 emacs libjansson.so.4.11.0 [.] json_delete
1.14% 5 emacs emacs [.] allocate_vectorlike
1.13% 5 emacs emacs [.] adjust_suspend_auto_hscroll
1.08% 5 emacs libjansson.so.4.11.0 [.] 0x0000000000007f40
0.94% 4 emacs emacs [.] insert_from_gap
0.91% 4 emacs libc-2.27.so [.] __memchr_avx2
0.89% 4 emacs emacs [.] allocate_vector
0.88% 4 emacs libjansson.so.4.11.0 [.] 0x00000000000041f0
0.84% 4 emacs libjansson.so.4.11.0 [.] 0x00000000000044cf
0.71% 3 emacs libjansson.so.4.11.0 [.] 0x0000000000007f1f
0.70% 3 emacs libjansson.so.4.11.0 [.] json_array_get
0.70% 3 emacs emacs [.] make_buffer_string_both
0.69% 3 emacs emacs [.] Fcurrent_buffer
0.69% 3 emacs emacs [.] mem_insert
0.69% 3 emacs libjansson.so.4.11.0 [.] json_string_value
0.68% 3 emacs libjansson.so.4.11.0 [.] 0x00000000000041ec
0.67% 3 emacs emacs [.] Fnext_property_change
0.67% 3 emacs libjansson.so.4.11.0 [.] 0x00000000000041dc
0.66% 3 emacs emacs [.] decode_coding
0.66% 3 emacs emacs [.] json_malloc
0.65% 3 emacs libjansson.so.4.11.0 [.] 0x00000000000041f7
0.63% 3 emacs libjansson.so.4.11.0 [.] 0x00000000000041e4
0.63% 3 emacs libjansson.so.4.11.0 [.] 0x0000000000004096
0.62% 1 emacs [kernel.kallsyms] [k] kmem_cache_alloc
0.62% 3 emacs libjansson.so.4.11.0 [.] 0x0000000000007e89
0.61% 3 emacs libjansson.so.4.11.0 [.] 0x00000000000040e0
0.47% 2 emacs emacs [.] invalidate_buffer_caches
0.47% 2 emacs emacs [.] allocate_string_data
0.46% 2 emacs emacs [.] del_range_2
0.46% 2 emacs emacs [.] assq_no_quit
0.46% 2 emacs emacs [.] code_convert_string
0.46% 2 emacs emacs [.] make_specified_string
0.46% 2 emacs libjansson.so.4.11.0 [.] 0x00000000000040a4
0.46% 2 emacs emacs [.] Fmake_local_variable
0.46% 2 emacs emacs [.] Fwiden
0.45% 2 emacs emacs [.] decode_coding_object
0.45% 2 emacs libjansson.so.4.11.0 [.] 0x0000000000003c1f
0.44% 2 emacs libjansson.so.4.11.0 [.] 0x00000000000040c5
0.43% 2 emacs libjansson.so.4.11.0 [.] 0x00000000000040bc
0.43% 2 emacs libjansson.so.4.11.0 [.] 0x0000000000004074
0.42% 2 emacs libjansson.so.4.11.0 [.] 0x0000000000007f53
0.42% 2 emacs libjansson.so.4.11.0 [.] 0x00000000000040ca
0.41% 2 emacs libjansson.so.4.11.0 [.] 0x000000000000408a
0.41% 2 emacs emacs [.] malloc@plt
0.41% 2 emacs libjansson.so.4.11.0 [.] 0x000000000000409e
0.40% 2 emacs libjansson.so.4.11.0 [.] json_array_append_new
0.40% 2 emacs emacs [.] pdumper_marked_p_impl
0.39% 2 emacs libjansson.so.4.11.0 [.] 0x0000000000008293
0.37% 2 emacs emacs [.] sweep_conses
0.37% 2 emacs emacs [.] sweep_vectors
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000043c9
0.23% 1 emacs emacs [.] free@plt
0.23% 1 emacs emacs [.] json_array_size@plt
0.23% 1 emacs emacs [.] Fassq
0.23% 1 emacs emacs [.] Fcons
0.23% 1 emacs emacs [.] make_vector
0.23% 1 emacs emacs [.] do_one_unbind.constprop.24
0.23% 1 emacs emacs [.] hashfn_eq
0.23% 1 emacs emacs [.] json_array_get@plt
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040df
0.23% 1 emacs emacs [.] code_conversion_save
0.23% 1 emacs [kernel.kallsyms] [k] rcu_nmi_enter
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000007e82
0.23% 1 emacs emacs [.] set_buffer_internal_1
0.23% 1 emacs libjansson.so.4.11.0 [.] json_integer_value
0.23% 1 emacs emacs [.] json_free
0.23% 1 emacs emacs [.] setup_coding_system
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000007e7d
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000008290
0.23% 1 emacs emacs [.] record_insert
0.23% 1 emacs emacs [.] set_internal
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000042e4
0.23% 1 emacs [kernel.kallsyms] [k] mem_cgroup_try_charge
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000041d0
0.23% 1 emacs emacs [.] validate_interval_range
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000044e7
0.23% 1 emacs emacs [.] json_make_string
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x000000000000483b
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004260
0.23% 1 emacs libc-2.27.so [.] __GI_____strtoll_l_internal
0.23% 1 emacs emacs [.] del_range_1
0.23% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004314
0.22% 1 emacs emacs [.] coding_set_destination
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004b80
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000007f33
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x000000000000407c
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040d1
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040e7
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004091
0.22% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004847
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040c0
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004e0e
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000007e74
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000007f4e
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x000000000000426a
0.21% 1 emacs emacs [.] balance_intervals
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004290
0.21% 1 emacs emacs [.] unbind_to
0.21% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040db
0.20% 1 emacs libjansson.so.4.11.0 [.] 0x00000000000040b1
0.20% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004854
0.20% 1 emacs libjansson.so.4.11.0 [.] 0x000000000000446e
0.20% 1 emacs emacs [.] pdumper_set_marked_impl
0.20% 1 emacs libjansson.so.4.11.0 [.] 0x000000000000452d
0.20% 1 emacs libjansson.so.4.11.0 [.] 0x0000000000004271
0.20% 1 emacs emacs [.] mem_find.part.20
0.19% 1 emacs emacs [.] mem_delete.part.28
0.18% 1 emacs emacs [.] mark_vectorlike
0.18% 1 emacs emacs [.] vectorlike_nbytes
0.00% 1 perf [kernel.kallsyms] [k] end_repeat_nmi
0.00% 1 emacs [kernel.kallsyms] [k] native_sched_clock
0.00% 3 perf [kernel.kallsyms] [k] native_write_msr
0.00% 2 emacs [kernel.kallsyms] [k] native_write_msr
0.00% 1 emacs [unknown] [.] 0000000000000000
#
# (Cannot load tips.txt file, please install perf!)
#
next prev parent reply other threads:[~2019-04-16 13:50 UTC|newest]
Thread overview: 161+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21f68973-a684-2a65-82eb-c8f3df90127f@yandex.ru \
--to=dgutov@yandex.ru \
--cc=31138@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=sebastien@chapu.is \
--cc=yyoncho@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).