Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# php-parser-in-rust

- When a change moves the performance numbers, update the benchmark table in `README.md` in the same PR. Take the numbers from the **Summary** of the Benchmark workflow run on that PR, not from a local run.
- The dump must stay byte-identical to the Go parser. Check with `tools/diff-corpus.sh <version> <dir>` and `cargo test`.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ CI reruns this on every push and every 12 hours, see the **Summary** of the Benc
bench/compare.sh ./laravel
```

What keeps it fast:

- the whole tree lives in one arena, so there is no allocation per node and nothing to free node by node
- the lexer allocates each token once; nodes hold a reference to it
- comments and strings are scanned with SIMD search (`memchr`)

## Usage

```rust
Expand Down
Loading