unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20154@debbugs.gnu.org
Subject: bug#20154: 25.0.50; json-encode-string is too slow for large strings
Date: Fri, 20 Mar 2015 16:43:36 +0200	[thread overview]
Message-ID: <550C3218.4000903@yandex.ru> (raw)
In-Reply-To: <83384zwxdx.fsf@gnu.org>

On 03/20/2015 04:34 PM, Eli Zaretskii wrote:

> I suggest to start with a detailed profile of the current
> implementation,

Any suggestions there? By the way, I've included the example, so you can 
also profile it yourself.

Here's the output of the built-in profiler, after using the current 
implementation:

CPU:

- command-execute                                   1147  79%
  - call-interactively                               1147  79%
   - funcall-interactively                           1082  74%
    - eval-last-sexp                                 1035  71%
     - elisp--eval-last-sexp                         1035  71%
      - eval                                         1035  71%
       - length                                      1035  71%
        - json-encode-string                         1035  71%
         - mapconcat                                  874  60%
            json-encode-char                          571  39%
    + execute-extended-command                         40   2%
    + previous-line                                     7   0%
   + byte-code                                         65   4%
- ...                                                298  20%
    Automatic GC                                      298  20%

Memory:

- command-execute                            255,362,537  99%
  - call-interactively                        255,362,537  99%
   - funcall-interactively                    255,349,159  99%
    - eval-last-sexp                          248,605,484  97%
     - elisp--eval-last-sexp                  248,605,484  97%
      - eval                                  217,011,432  84%
       - length                               217,011,432  84%
        - json-encode-string                  217,011,432  84%
         - mapconcat                           93,689,099  36%
            json-encode-char                   81,784,197  32%
           format                                     814   0%
        elisp--eval-last-sexp-print-value          11,954   0%
      + elisp--preceding-sexp                       2,048   0%
    + execute-extended-command                  6,743,643   2%
    + previous-line                                    32   0%
   + byte-code                                     13,378   0%
+ xselect-convert-to-string                          176   0%
   ...                                                  0   0%






  reply	other threads:[~2015-03-20 14:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 14:26 bug#20154: 25.0.50; json-encode-string is too slow for large strings Dmitry Gutov
2015-03-20 14:34 ` Eli Zaretskii
2015-03-20 14:43   ` Dmitry Gutov [this message]
2015-03-20 15:03     ` Eli Zaretskii
2015-03-20 15:20       ` Dmitry Gutov
2015-03-20 16:02         ` Eli Zaretskii
2015-03-20 16:21           ` Dmitry Gutov
2015-03-20 16:44             ` Eli Zaretskii
2015-03-20 16:52               ` Dmitry Gutov
2015-03-20 17:44                 ` Eli Zaretskii
2015-03-20 18:42                   ` Dmitry Gutov
2015-03-20 21:14                     ` Eli Zaretskii
2015-03-20 22:02                       ` Dmitry Gutov
2015-03-21  7:58                         ` Eli Zaretskii
2015-03-21  8:12                           ` Eli Zaretskii
2015-03-21 20:00                           ` Dmitry Gutov
2015-03-21 20:25                             ` Eli Zaretskii
2015-03-21 21:26                               ` Dmitry Gutov
2015-03-22 17:31                                 ` Eli Zaretskii
2015-03-22 18:13                                   ` Dmitry Gutov
2015-03-22 18:26                                   ` Dmitry Gutov
2015-03-22 18:32                                     ` Eli Zaretskii
2015-03-22 19:03                                       ` Dmitry Gutov
2015-03-21 21:05                             ` Drew Adams
2015-03-21 21:32                               ` Dmitry Gutov
2015-04-20 22:20                         ` Ted Zlatanov
2015-04-20 22:41                           ` Dmitry Gutov
2015-04-20 23:11                             ` Ted Zlatanov
2015-03-20 22:26                       ` Dmitry Gutov
2015-03-21  8:07                         ` Eli Zaretskii
2015-03-21 21:09                           ` Dmitry Gutov
2015-03-21 22:20                             ` Ivan Shmakov
2015-03-21 23:36                               ` Dmitry Gutov
2015-03-22 14:52                             ` Dmitry Gutov
2015-03-22 16:15                               ` Ivan Shmakov
2015-03-22 16:47                                 ` Dmitry Gutov
2015-03-22 17:43                                   ` Eli Zaretskii
2015-03-22 19:15                                   ` Ivan Shmakov
2015-03-22 16:51                                 ` Eli Zaretskii
2015-03-22 18:22                                 ` Glenn Morris
2015-03-22 16:50                               ` Eli Zaretskii
2015-03-22 17:10                                 ` Dmitry Gutov
2015-03-22 22:57           ` Dmitry Gutov
2015-03-23 15:37             ` Eli Zaretskii
2015-04-07 13:31               ` 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=550C3218.4000903@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=20154@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).