A slop fork of Tree-sitter to fix some inefficiencies.
- Rust 64.2%
- C 24.4%
- TypeScript 6.3%
- C++ 1.3%
- JavaScript 1%
- Other 2.6%
Reshaping the table builder for memory needs a way to tell where the memory goes, and a profiler attributes allocation sites rather than phases: it says which call allocated, not which phase still holds the result. What matters here is what a phase *retains*. The CLI installs a tracking global allocator that keeps a running total of live bytes and their high-water mark, and the generator reports the totals at each phase boundary. Sizes for individual structures come from dropping or clearing them and differencing the live total, which is exact, rather than from estimating a layout. Everything stays quiet unless TS_MEM_STATS is set, so an instrumented binary behaves like an uninstrumented one; accounting itself is two relaxed atomics per allocation and does not measurably change generation time. TS_MEM_SIZES additionally sizes structures by cloning them, which inflates the very peak the phase report exists to measure and is therefore separate. TS_MEM_DISSECT takes the finished table apart to attribute it field by field, and necessarily ends the run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .cargo | ||
| .github | ||
| .zed | ||
| crates | ||
| docs | ||
| lib | ||
| test/fixtures | ||
| .dockerignore | ||
| .editorconfig | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| flake.lock | ||
| flake.nix | ||
| FUNDING.json | ||
| LICENSE | ||
| Makefile | ||
| Package.swift | ||
| README.md | ||
tree-sitter
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. Tree-sitter aims to be:
- General enough to parse any programming language
- Fast enough to parse on every keystroke in a text editor
- Robust enough to provide useful results even in the presence of syntax errors
- Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application