emacs-devel
[Top][All Lists]
Advanced

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

Re: treesitter local parser: huge slowdown and memory usage in a long fi


From: Eli Zaretskii
Subject: Re: treesitter local parser: huge slowdown and memory usage in a long file
Date: Tue, 13 Feb 2024 14:59:53 +0200

> From: Yuan Fu <casouri@gmail.com>
> Date: Tue, 13 Feb 2024 00:15:49 -0800
> Cc: Vincenzo Pupillo <v.pupillo@gmail.com>,
>  emacs-devel@gnu.org
> 
> > So my suggestion would be to define the range from position of point,
> > using the window dimensions; see get_narrowed_width for ideas.  This
> > could lose if the buffer has a lot of invisible text, so I suggest to
> > check for invisible properties, and if they are present in the buffer,
> > punt and use the whole accessible portion of the buffer (I don't
> > expect PHP buffers, or any buffers in programming-language modes, to
> > have invisible text).
> 
> Ah, clever :-) Programming language buffers could have invisible text when 
> the user uses hideshow, or folded some section of code using 
> outline-minor-mode :-(

If having invisible text in such buffers is frequent enough, you could
look for the first position before the region beginning that is
visible, and the first position after the region end that is visible,
and use that as the range.



reply via email to

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