[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: |
Yuan Fu |
Subject: |
Re: treesitter local parser: huge slowdown and memory usage in a long file |
Date: |
Mon, 27 May 2024 15:05:22 -0700 |
> On May 25, 2024, at 9:23 PM, Stefan Monnier via Emacs development
> discussions. <emacs-devel@gnu.org> wrote:
>
>> The only problem is to decide how long a history of updated ranges do we
>> keep for each parser. The 100% correct approach is to maintain a separate
>> history for each consumer, and never throw away old ranges until the
>> consumer consumes them. But then you risk wasting memory if some consumer
>> never consumes the ranges. To handle that we can add a hard limit. But then
>> this hard limit might be too low for some edge case… We can make this hard
>> limit configurable, and if we ever encountered a case where this hard limit
>> is not enough and there’s no way around it (unlikely), we can instruct users
>> or lisp program to increase it.
>
> Side note: the above is fairly close to describing `track-changes.el`.
> [ where I don't have any hard limit, currently. ]
>
I see. I suppose you had to shift “modified region” around according to later
edits, right?
Yuan
Re: treesitter local parser: huge slowdown and memory usage in a long file, Stefan Monnier, 2024/05/26