[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reliable after-change-functions (via: Using incremental parsing in E
Tuấn Anh Nguyễn
Re: Reliable after-change-functions (via: Using incremental parsing in Emacs)
Wed, 1 Apr 2020 00:07:27 +0700
> In any case, I hope that passing the buffer to tree-sitter doesn't
> involve marshalling the entire buffer text via a function call as a
> huge string, or some such. We should instead request that tree-sitter
> exposes an API through which we could give it direct access to buffer
> text as 2 parts, before and after the gap, like we do with regex
> code. Otherwise this will be a bottleneck in the long run, not unlike
> the problem we have with LSP.
It does support parsing through direct access. Which is why I wanted
dynamic modules to have direct access to buffer text.
>> How large is "very large" here?
> xdisp.c comes to mind, obviously.
On my machine, a 3.39 GHz Intel Core i7:
(0.150791 0 0.0) ; 1 full parse
(2.142236 5 0.6105190000000107) ; 10 full parses
(0.015423 0 0.0) ; incremental parsing, after typing 1 character
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs),
Tuấn Anh Nguyễn <=