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

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

bug#64391: buffer narrowing slowdown regression in emacs 29


From: Mattias Engdegård
Subject: bug#64391: buffer narrowing slowdown regression in emacs 29
Date: Sat, 1 Jul 2023 13:37:08 +0200

1 juli 2023 kl. 06.59 skrev Andrew Cohen <acohen@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.)

Attachment: narrow-to-region-with-label.diff
Description: Binary data


reply via email to

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