GNU bug report logs - #20154
25.0.50; json-encode-string is too slow for large strings

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Fri, 20 Mar 2015 14:27:01 UTC

Severity: normal

Found in version 25.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 20154 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20154 <at> debbugs.gnu.org
Subject: Re: bug#20154: 25.0.50; json-encode-string is too slow for
 large strings
Date: Fri, 20 Mar 2015 16:43:36 +0200
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%





This bug report was last modified 10 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.