GNU bug report logs - #31888
27.0.50; Segmentation fault in replace-buffer-contents

Previous Next

Package: emacs;

Reported by: MichaƂ Kondraciuk <k.michal <at> zoho.com>

Date: Mon, 18 Jun 2018 21:00:04 UTC

Severity: normal

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: joaotavora <at> gmail.com
Cc: Alan Mackenzie <acm <at> muc.de>, k.michal <at> zoho.com, Stefan Monnier <monnier <at> iro.umontreal.ca>, 31888 <at> debbugs.gnu.org
Subject: bug#31888: 27.0.50; Segmentation fault in replace-buffer-contents
Date: Fri, 29 Jun 2018 17:07:25 +0300
> Date: Mon, 25 Jun 2018 17:54:16 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 31888 <at> debbugs.gnu.org, k.michal <at> zoho.com
> 
> However, I'm working on profiling this command with better
> granularity, so maybe I will have additional ideas for speeding it up.

As usual, good profiling tools indicate that the problem was in
entirely unexpected places.

I've now pushed changes that make replace-buffer-contents run between
7 and 10 times faster in the use case that was posted at the beginning
of this bug report: it now finishes in 12 to 22 seconds instead of
more than 2 minutes.  Please see if these changes have any significant
effect in your case.

One aspect of the changes for which I'd like some feedback (and CC
Stefan and Alan) is that the modified code no longer calls the
modification hooks for each small insertion or deletion that the
optimized replacement script calls; instead, we call the modification
hooks just once before the series of changes and once after them.
Doing this speeds up the function by a factor of 2, so if we give up
that twofold speedup, we should do that only for a very good reason.




This bug report was last modified 6 years and 327 days ago.

Previous Next


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