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

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

bug#56682: Fix the long lines font locking related slowdowns


From: Stefan Monnier
Subject: bug#56682: Fix the long lines font locking related slowdowns
Date: Tue, 02 Aug 2022 18:04:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> Another piece of the puzzle was added by Stefan in 15b2138719b340.
> That looked promising, but sadly it had only a very limited effect.

FWIW, that was also my experience :-(

>> So perhaps we should re-evaluate the testing scenario to see where the
>> current bottlenecks are. If we current main issue is the 55s spent in
>> syntax-ppss, a more constructive approach would be to look into optimizing
>> parse-partial-sexp. Or even give up on certain scenarios, admitting that
>> waiting 55s once to visit the end of a 1 GB buffer is not so bad (and that
>> could part could also be sped up by setting syntax-propertize-function to
>> nil and using a very simple syntax table, for instance).

Those 55s were with a `syntax-propertize-function` set to nil already.

We could do a bit better in some modes, tho, e.g. in fundamental mode no
char has string or comment syntax, IIRC, so we could arguably make
`syntax-ppss` return a value without parsing anything at all (except
that `syntax-ppss` is also supposed to count parentheses, which *are*
present in fundamental-mode).

> It is bad, especially now that it became clear that in fact it's not
> "waiting 55s once" but "waiting 55s each time the buffer is modified and you
> move to another position in the buffer".

Actually, if 55s is the time it takes from BOB to EOB, then the time for
"change at POS1 plus move to POS2" should be approximately

    55s * (POS2 - POS1) / (buffer-size)


-- Stefan






reply via email to

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