Add tree-sitter performance note
This commit is contained in:
parent
ad624b961b
commit
c916f471ca
1 changed files with 12 additions and 0 deletions
12
admin/notes/tree-sitter/performance
Normal file
12
admin/notes/tree-sitter/performance
Normal file
|
@ -0,0 +1,12 @@
|
|||
TREE-SITTER PERFORMANCE NOTES -*- org -*-
|
||||
|
||||
* Facts
|
||||
|
||||
Incremental parsing of a few characters worth of edit usually takes
|
||||
less than 0.1ms. If it takes longer than that, something is wrong. There’s one time where I found tree-sitter-c takes ~30ms to incremental parse. Updating to the latest version of tree-sitter-c solves it, so I didn’t investigate further.
|
||||
|
||||
The ranges set for a parser doesn’t grow when you insert text into a
|
||||
range, so you have to update the ranges every time before
|
||||
parsing. Fortunately, changing ranges doesn’t invalidate incremental
|
||||
parsing, so there isn’t any performance lost in update ranges
|
||||
frequently.
|
Loading…
Add table
Reference in a new issue