emacs-devel
[Top][All Lists]
Advanced

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

Re: New optimisations for long raw strings in C++ Mode.


From: Stefan Monnier
Subject: Re: New optimisations for long raw strings in C++ Mode.
Date: Thu, 11 Aug 2022 03:37:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> `syntax-begin-function` could use such a thing, but we made it obsolete
>> because making it work well tends to be costly.
> More costly than going back 20 million characters and then coming back?

The design decisions around `syntax-begin-function` were based on
experience for "normal" files.  IOW, for normal files it proved too
costly (either in terms of execution or programming costs, or in terms
of extra coding style requirements imposed on the user
(e.g. open-paren-in-column-0)).

In the message to which you replied I indeed point out that the trade
off might very well be different for large files.

> IOW, what is and isn't costly could change when compared with
> alternatives.  For example, I recently made one of low-level
> subroutines in the display engine do something "costly" when the
> buffer has very long lines, and the result turned out to be a very
> large win in those cases.  The "heavy" calculation is only used when
> the buffer is flagged to have very long lines; we could do something
> similar for syntax analysis as well.

I think we're in agreement.


        Stefan




reply via email to

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