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

From: Gregory Heytings <gregory <at> heytings.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 56682 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#56682: Fix the long lines font locking related slowdowns
Date: Mon, 01 Aug 2022 09:56:11 +0000
[Message part 1 (text/plain, inline)]
>> Given your and Dmitry's feedback, I just tried to add an explicit call 
>> to (syntax-ppss (point-max)), without narrowing, when the buffer is 
>> opened (see below).
>> 
>> The problem is that this is, as I said, slow.  On my laptop, opening a 
>> 1 GB file takes about 6 seconds.  The call to syntax-ppss adds 70 
>> seconds, so opening a large file becomes an order of magnitude slower 
>> (13 times slower).  Which I think is too much for the added benefit.
>
> But that only has to happen when the buffer is scrolled to the bottom, 
> right?
>

No, it happens when the buffer is opened.  Given the importance that you 
and Stefan seem to give to that function, it is, with the patch I sent in 
my previous post, called once on the whole buffer (without any narrowing) 
when the file is opened.  Later calls (inside fontification-functions or 
post-command-hook) are subject to a forced narrowing.

>
> And syntax-ppss's speed depends on the rules applied by the particular 
> major mode. Those could be sped up. Some optimization of this function's 
> speed is not out of the question either.
>

They would be more than welcome.  In fact, without such optimizations, it 
would be unreasonable to do what the patch does.

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.