
# Benchmarks

`@tsrx/yuku` against the official parser, [`@tsrx/core`](https://www.npmjs.com/package/@tsrx/core), both building an ESTree AST. The numbers on this page are read from the repository when the site is built: the chart from [`bench/chart.svg`](https://github.com/tsrx-org/yuku/blob/main/bench/chart.svg) and the table from the [README](https://github.com/tsrx-org/yuku#benchmark).

## The test suite

Parsing the 1,987 TSRX sources of the [test suite](https://github.com/tsrx-org/yuku/tree/main/test/suite) that parse.

![Time per file to parse the test suite: @tsrx/yuku 4.8 µs, @tsrx/core 43.9 µs](https://yuku.tsrx.dev/assets/d5b2357961cc/bench/chart.svg)

4.8 µs a file against 43.9 µs: 9.2x faster. Median time per file over 3 runs, each in a fresh Node.js 24 process on an Apple M5 Pro.

## The pages of tsrx.dev

The pages of [tsrx.dev](https://tsrx.dev), 319 kB in all, in milliseconds, the same way over 5 runs.

| page | @tsrx/yuku | @tsrx/core 0.5.5 |
| --- | ---: | ---: |
| specification | 0.554 | 1.949 |
| getting-started | 0.431 | 2.059 |
| features | 0.376 | 1.726 |
| compiler-demo | 0.145 | 1.451 |
| blog-rethinking-tsrx | 0.094 | 0.396 |
| blog-removing-lazy-destructuring | 0.084 | 0.301 |
| index | 0.083 | 0.385 |
| blog-simplifying-tsrx-after-feedback | 0.069 | 0.334 |
| blog | 0.028 | 0.127 |
| playground | 0.013 | 0.093 |
| layout | 0.006 | 0.176 |
| total | 1.883 | 8.998 |

4.8x faster than `@tsrx/core` in all, 1.883 ms against 8.998 ms.

## Run them

```sh
git clone https://github.com/tsrx-org/yuku
cd yuku
bun install
bun run bench
```

It needs Zig 0.17, Bun, and Node.js 24, as [Work on it](/architecture/how-it-works#work-on-it) describes. `bun run bench` builds the package, then times each parser over every source of `test/suite/pass` with [tinybench](https://github.com/tinylibs/tinybench), each run in a fresh Node.js process, and writes `bench/chart.svg` with the median. Run it on a quiet machine. A change that makes parsing slower needs these numbers before and after.

## Yuku

The parser underneath is [Yuku](https://yuku.fyi). Its own benchmarks, natively and on npm, against Oxc, SWC, Babel, and Acorn, are on [yuku.fyi](https://yuku.fyi/#performance).
