emacs-devel
[Top][All Lists]
Advanced

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

Re: Major modes using `widen' is a good, even essential, programming pra


From: Dmitry Gutov
Subject: Re: Major modes using `widen' is a good, even essential, programming practice.
Date: Sun, 7 Aug 2022 21:05:44 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 07.08.2022 21:00, Eli Zaretskii wrote:
Date: Sun, 7 Aug 2022 20:53:58 +0300
Cc:gregory@heytings.org,emacs-devel@gnu.org
From: Dmitry Gutov<dgutov@yandex.ru>

On 07.08.2022 20:23, Eli Zaretskii wrote:
What jit-lock/font-lock actually do at the moment is to widen, then use
syntax-ppss, i.e. in effect scan from BOB.
Yes, and that's SLOOOWWWW!
It's not slow on files of reasonable size. E.g. even if we take xdisp.c
(the file I've seen referred to in complaints on CC Mode's speed),

    (benchmark 1 '(save-excursion (parse-partial-sexp (point-min)
(point-max))))

reports 20-50 ms on my machine.
It takes 0.5 sec here.

Interesting. That would mean that scrolling to the end of xdisp.c will at least take this long the first time around.

The more than 10x difference in performance is weird, though. Perhaps you have any ideas why parse-partial-sexp's implementation might behave poorly on your un-optimized build? Some tweak in the code might make a lot of difference.

This is an area I can't be of much help with, unfortunately.



reply via email to

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