emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter navigation time grows as sqrt(line-number)


From: Dmitry Gutov
Subject: Re: Tree-sitter navigation time grows as sqrt(line-number)
Date: Fri, 18 Aug 2023 16:21:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 18/08/2023 08:20, Yuan Fu wrote:

I’m not too worried tho, because IIRC the absolute time is very short. The 100x 
variability doesn’t mean much if the 100x is still very fast.


This is on a brand new fast machine, and 3ms is pretty slow for things that 
need to run dozens of times per keystroke (e.g. font-lock).

Font-lock doesn’t need to find the parent of a node. So that hasn’t been a 
problem. In use-cases where finding the parent of a node is useful, 3ms hasn’t 
been a problem AFAIK. (Well, I guess indentation could benefit from a faster 
parent-finding function.)

It could be unrelated, but someone on Reddit complained about the speed of rust-ts-mode's font-lock in a large enough file, and this mode's fontification rules contain treesit-node-parent calls.



reply via email to

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