emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43016: closed (replace-region-contents takes a lot of time when call


From: GNU bug Tracking System
Subject: bug#43016: closed (replace-region-contents takes a lot of time when called from json-pretty-print-buffer)
Date: Tue, 25 Aug 2020 18:20:02 +0000

Your message dated Tue, 25 Aug 2020 11:19:47 -0700
with message-id <eea085ce-e664-7256-3c5b-4fe804c62412@cs.ucla.edu>
and subject line Re: bug#43016: replace-region-contents takes a lot of time 
when called from json-pretty-print-buffer
has caused the debbugs.gnu.org bug report #43016,
regarding replace-region-contents takes a lot of time when called from 
json-pretty-print-buffer
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
43016: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43016
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: replace-region-contents takes a lot of time when called from json-pretty-print-buffer Date: Mon, 24 Aug 2020 08:25:14 +0000
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.

Using Windows version from GNU ftp :

GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of 2020-08-12


--- End Message ---
--- Begin Message --- Subject: Re: bug#43016: replace-region-contents takes a lot of time when called from json-pretty-print-buffer Date: Tue, 25 Aug 2020 11:19:47 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
On 8/25/20 10:30 AM, Tassilo Horn wrote:

Seems to work fine for me too with all three files of this report and
the large one from bug#42931.  It seems like the early abort will now
happen shortly after MAX-SECS bounds.

Thanks for checking; closing the Emacs bug report.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]