GNU bug report logs - #56682
Fix the long lines font locking related slowdowns

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Thu, 21 Jul 2022 18:01:01 UTC

Severity: normal

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 56682 <at> debbugs.gnu.org, gregory <at> heytings.org, dgutov <at> yandex.ru
Subject: Re: bug#56682: Fix the long lines font locking related slowdowns
Date: Sat, 13 Aug 2022 09:13:48 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Dmitry Gutov <dgutov <at> yandex.ru>,  Eli Zaretskii <eliz <at> gnu.org>,
>   56682 <at> debbugs.gnu.org
> Date: Fri, 12 Aug 2022 22:01:54 -0400
> 
> > I can only repeat that the only ways to improve font locking in a non-local
> > way (or at least, the only ways that were identified in the discussions so
> > far) are either to improve the speed of syntax-ppss by an order of
> > magnitude, in which case it would perhaps become feasible to allow
> > syntax-ppss to have access to the whole buffer, or to equip syntax-ppss with
> > heuristics to make it work "as well as possible" even when it only has
> > access to a portion of the buffer.
> 
> But the locked narrowing is applied based on the presence of long-lines
> rather than based on the total size of the buffer.

That's true, but the two are closely related: a buffer with very long
lines tends also to be a large buffer.

> I think we'll want to decouple the two because they aren't quite the
> same (e.g. in many cases the time taken by `syntax-ppss` doesn't depend
> on the length of lines, whereas the time taken by `font-lock-keywords`
> rues does not depend on the total buffer size).

The solutions for stuff that depends on buffer size will indeed be
different from solutions for stuff that depends on line size.
However, font-lock currently depends on both, and narrowing solves
both, albeit in non-specific ways.




This bug report was last modified 2 years and 8 days ago.

Previous Next


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