all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: ljell <laszlomail@protonmail.com>, Tassilo Horn <tsdh@gnu.org>
Cc: 43016@debbugs.gnu.org
Subject: bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer
Date: Mon, 24 Aug 2020 13:37:39 +0300	[thread overview]
Message-ID: <83blj072j0.fsf@gnu.org> (raw)
In-Reply-To: <pyeSLFUJy1o2IQVpmkVsGy2zP2TbP6yWoGgfoy1IfNiaHWMERNSUDw-64_xFCaasSAx700HtjHyt1t_QVTzMuDQIg4MaqgUMme5sN--DWDc=@protonmail.com> (bug-gnu-emacs@gnu.org)

> Date: Mon, 24 Aug 2020 08:25:14 +0000
> From: ljell via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I have a code which pretty prints data in json:
> 
> ...
>   (with-temp-buffer
>     (insert data)
>     (json-pretty-print-buffer)
>     (write-file "data.json"))
> ...
> 
> This code runs for several minutes (I didn't time it, but it's about 1-2 minutes) with Emacs 27.1  It takes
> several seconds with Emacs 26.  Data is about 1MB on disk in pretty printed elisp format.
> 
> I tried profiling with this result:
> 
>           - progn                                                7486  98%
>            - json-pretty-print-buffer                            7438  98%
>             - json-pretty-print                                  7438  98%
>              - replace-region-contents                           7438  98%
>               + #<compiled 0x3854909>                             198   2%
>            + insert                                                43   0%
>            + write-file                                             5   0%
> 
> Apparently, replace-region-contents  takes 98% of the CPU time.

Thank you for your report and the data.  Is it possible to have the
file with which you've seen this problem?

Tassilo, could you please look into this regression?





  reply	other threads:[~2020-08-24 10:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24  8:25 bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer ljell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-24 10:37 ` Eli Zaretskii [this message]
2020-08-24 12:13   ` ljell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-24 12:29     ` ljell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-08-24 17:14     ` Tassilo Horn
2020-08-24 17:21       ` Lars Ingebrigtsen
2020-08-24 17:25         ` Philipp Stephani
2020-08-24 17:27       ` Eli Zaretskii
2020-08-24 19:15         ` Tassilo Horn
2020-08-24 19:36           ` Eli Zaretskii
2020-08-24 23:35       ` Paul Eggert
2020-08-25  6:10         ` Eli Zaretskii
2020-08-25 18:26           ` Paul Eggert
2020-08-25 17:30         ` Tassilo Horn
2020-08-25 18:19           ` Paul Eggert

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83blj072j0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43016@debbugs.gnu.org \
    --cc=laszlomail@protonmail.com \
    --cc=tsdh@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.