mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
We have to pay the cost of compiling the regex at runtime, and the `LazyLock` overhead for each access. The pattern is simple enough that we can manually parse and extract. `grammar_json_name` is now ~116x faster on cold start, ~5.6x faster warm (after the regex has been compiled). Both are fast enough to not matter much in practice, but some perf gains and eliminating global state is a win. |
||
|---|---|---|
| .. | ||
| src | ||
| binaryen-version | ||
| build.rs | ||
| Cargo.toml | ||
| emscripten-version | ||
| LICENSE | ||
| README.md | ||
| wasi-sdk-version | ||
Tree-sitter Loader
The tree-sitter command-line program will dynamically find and build grammars
at runtime, if you have cloned the grammars' repositories to your local
filesystem. This helper crate implements that logic, so that you can use it in
your own program analysis tools, as well.