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

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

bug#56682: locked narrowing


From: Eli Zaretskii
Subject: bug#56682: locked narrowing
Date: Wed, 30 Nov 2022 05:42:03 +0200

> Date: Wed, 30 Nov 2022 00:15:39 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: 56682@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>, 
>     Stefan Monnier <monnier@iro.umontreal.ca>
> 
> 
> >> The result will be that the benchmark will report ~30ms both near BOB 
> >> and near EOB. So the long-lines-threshold thingy adds a regression 
> >> here.
> >
> > It's not a regression, it's the price we agreed to pay to detect whether 
> > the buffer contains long lines.  That detection happens dynamically, to 
> > catch cases when long lines are inserted in a buffer.
> >
> 
> After looking at this closely, it turns out that the change in 1c837c42c2 
> doesn't do what it was meant to do.  Sigh...  Dmitry, can you confirm that 
> the following change fixes this?

I think this is just one aspect of the issue.  The loop under this condition
"punishes" large buffers with no long lines because we search the entire
buffer top to bottom.  To make this scale better, I think we should only
search in some predefined vicinity of the window, perhaps the same region to
which we narrow the buffer when we do detect long lines.  We can then repeat
the search if point moves far away from its last value.

There's no need to search the whole buffer, that will cause delays in very
large buffers for no good reason.

We've talked about this a few months ago, and you said fixing this was part
of your todo.  I think now is the time.





reply via email to

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