GNU bug report logs - #64391
30.0.50; buffer narrowing slowdown regression in emacs 29

Previous Next

Packages: emacs, gnus;

Reported by: Andrew Cohen <acohen <at> ust.hk>

Date: Sat, 1 Jul 2023 00:21:02 UTC

Severity: normal

Found in version 30.0.50

Full log


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

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: acohen <at> ust.hk, 64391 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 monnier <at> iro.umontreal.ca
Subject: Re: bug#64391: buffer narrowing slowdown regression in emacs 29 
Date: Fri, 7 Jul 2023 11:30:11 +0200
6 juli 2023 kl. 20.45 skrev Gregory Heytings <gregory <at> heytings.org>:

>> How are those different from what Mattias proposed?  Is this a completely different set of changes, or is it what Mattias suggested, just in several separate parts?
>> 
> 
> It resembles what Mattias proposed of course (remove the negative effect of setting a buffer-local variable in all calls to narrow-to-region, and limit it to case when labeled narrowing is used), but it's nonetheless different.  The essential change is isolated in the first commit, and in the second commit, instead of moving the body of Fnarrow_to_region to another function with an additional (third) argument, I use another separate function which calls Fnarrow_to_region.  I believe the result is clearer.

Gregory's first two patches and mine are indeed equivalent up to refactoring; either would do. The moving parts are the same, so performance shouldn't differ noticeably. Neither appears to tie our hands for future changes as the interfaces are all internal.

The third of Gregory's patches appears mainly cosmetic. Maybe that one is less important for emacs-29.

I have one question about the new `with-restriction` macro: if it is intended as a convenience macro for unlabelled narrowing as well, shouldn't it then expand to the obvious

  (save-restriction
    (narrow-to-region BEG END)
    BODY)

instead the much more expensive call to a helper function?

The documentation should also make it clear that `nil` is not a valid label.





This bug report was last modified 1 year and 342 days ago.

Previous Next


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