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

Previous Next

Packages: gnus, emacs;

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 #23 received at 64391 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Andrew Cohen <acohen <at> ust.hk>
Cc: 64391 <at> debbugs.gnu.org, Gregory Heytings <gregory <at> heytings.org>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#64391: buffer narrowing slowdown regression in emacs 29 
Date: Sat, 1 Jul 2023 13:37:08 +0200
[Message part 1 (text/plain, inline)]
1 juli 2023 kl. 06.59 skrev Andrew Cohen <acohen <at> ust.hk>:

> Just for fun I simply commented it out (since the test code doesn't use
> labeled restrictions) and ran the test code, and the problem disappears:

The attached patch combines narrow-to-region and internal--label-restriction into a single function, internal--narrow-to-region. (We could also add the label as an optional argument to narrow-to-region.)

As a result, the up-front consing and marker allocation disappear entirely for normal (unlabelled) narrowing, as does the expensive buffer-local `outermost-restriction` variable.

Labelled narrowing is almost as expensive as before but is, we hope, less common. Maybe we can work separately on reducing its cost.

(And to those reading the patch: yes, some work on doc strings is needed. Suggestions welcome.)

[narrow-to-region-with-label.diff (application/octet-stream, attachment)]

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.