I've seen "load bearing" so many times in AI now I can't remember whether we always used "load bearing wall" to refer to a structural interior wall, or whether it's a recent AI-ism.
Maybe I am missing what they meant here, but isn’t the entire point of tree-sitter that you can reuse old trees to make edit updates faster? It is seems quite probable that all the performance gains came from optimising for fixed files with no error recovery, at the cost of how ts is actually used.
Made a tree-sitter powered text editor. Implementing incremental parsing improved performance from 5ms to 400us for small edits in a ~100LOC file. For many applications tree-sitter without incremental parsing makes no sense, but I guess it's not a problem for ast-grep.
> isn’t the entire point of tree-sitter that you can reuse old trees to make edit updates faster?
I've used tree-sitter for a few projects, but I never touched the tree-reuse stuff. The value of tree-sitter came from the fact that grammars compile to a .so and can be easily distributed through package managers. Adding support for a new grammar in ast-grep might just mean pointing to the .so at runtime (idk, I haven't checked). So this optimization might make sense for this project.
I like ast-grep and I think the changes are interesting, but it isn't fun reading an ai-generated article.
It seems like a lot of the speedup comes from using an arena, using realloc with offsets rather than raw pointers and some change to the graph that enabled this (though I don't want to re-read it to confirm).
AlexeyBrin | 23 hours ago
trollbridge | 21 hours ago
rayiner | 20 hours ago
hidd | 20 hours ago
[1]: https://youtu.be/IbVmxkVC5kc?t=83
thejazzman | 17 hours ago
https://amphetamem.es/meme/?id=the-simpsons_08_08_248&text=I...
trickypr | 22 hours ago
Maybe I am missing what they meant here, but isn’t the entire point of tree-sitter that you can reuse old trees to make edit updates faster? It is seems quite probable that all the performance gains came from optimising for fixed files with no error recovery, at the cost of how ts is actually used.
ivanjermakov | 22 hours ago
sweetgiorni | 21 hours ago
I've used tree-sitter for a few projects, but I never touched the tree-reuse stuff. The value of tree-sitter came from the fact that grammars compile to a .so and can be easily distributed through package managers. Adding support for a new grammar in ast-grep might just mean pointing to the .so at runtime (idk, I haven't checked). So this optimization might make sense for this project.
gumby | 21 hours ago
jibal | 17 hours ago
No, not for ast-grep.
gumby | 21 hours ago
senderista | 20 hours ago
nullbio | 19 hours ago
why_only_15 | 17 hours ago
anitil | 17 hours ago
It seems like a lot of the speedup comes from using an arena, using realloc with offsets rather than raw pointers and some change to the graph that enabled this (though I don't want to re-read it to confirm).