emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter integration on feature/tree-sitter (severe performance i


From: Yuan Fu
Subject: Re: Tree-sitter integration on feature/tree-sitter (severe performance issues together with linum-mode)
Date: Fri, 19 Aug 2022 14:58:49 -0700


> On Aug 18, 2022, at 11:01 PM, Jostein Kjønigsen 
> <jostein@secure.kjonigsen.net> wrote:
> 
> On 18.08.2022 11:44, Yuan Fu wrote:
>> 
>> Good news, the slowness can be easily resolved by compiling the query 
>> pattern in csharp-mode-font-lock-settings-1 (this is a recent addition to 
>> treesit).
>> 
>> Yuan
>> 
> Thanks for the reply and thanks for looking into this.
> 
> I can confirm that by compiling the query like you suggested, and replacing 
> linum-mode with nlinum-mode, I'm not experiencing any performance issues any 
> more!
> 
> To avoid issues like this... Should perhaps the function 
> treesit-query-capture (in treesit.c) emit a warning/message when encountering 
> non-compiled queries?
> 
> That way writing more performant major-modes would be more self-explanatory, 
> resulting in a better, faster Emacs for everyone.

Warning/message seems a bit drastic. There are valid use-cases where one want 
to use an uncompiled query. For now I have words in the docstring that advices 
using compiled queries (albeit not in all caps :-)

Yuan


reply via email to

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