Benchmarks
The benchmarks measure the JavaScript the grid runs on a scroll event and when it starts. They run in Node with a simulated DOM, so they leave out the browser's layout and paint, and the code in your slots.
Every benchmark uses a list of 1,000,000 items in 10 columns of 100px by 100px, in a window of 1024px by 768px.
Results
Versions 1.1.6 and 1.2.0, run one after the other on an Apple M1 with Node 26.13 and Vitest 4.0. The 1.1.6 column runs the same benchmark files against the 1.1.6 source. Every value is the mean time of one run.
Scrolling
Each run sends 20 scroll events through the grid's pipeline.
| Benchmark | 1.1.6 | 1.2.0 |
|---|---|---|
| 20 scroll events that each move the rendered window by one row | 1,530 ms | 0.40 ms |
| 20 scroll events of 2px each, which rarely move the rendered window | 0.017 ms | 0.004 ms |
In 1.2.0, one scroll event that moves the rendered window by a row takes about 20 µs. A frame at 60 frames per second lasts 16.7 ms, so the grid's code takes well under 1% of a frame. In 1.1.6 the same event took about 77 ms, which is more than four frames.
Computing the rendered window
Both rendered-window benchmarks call the functions that compute the rendered window directly, 20 times per run.
| Benchmark | 1.1.6 | 1.2.0 |
|---|---|---|
| 20 rendered-window updates, one row apart | 1,460 ms | 0.89 ms |
| 20 rendered-window updates within one row | 1,610 ms | 0.80 ms |
Starting
| Benchmark | 1.1.6 | 1.2.0 |
|---|---|---|
| Create the grid's pipeline and wait until it is ready | 44 ms | 0.82 ms |
| The same, then recompute the layout once | 50 ms | 0.74 ms |
The 1.1.6 values varied between two runs, from 34 ms to 54 ms for creating the pipeline and waiting until it is ready. The 1.2.0 values varied by about 5%.
Run the benchmarks
Clone the repository, install with pnpm install, then run the benchmarks from the repository root.
pnpm install fails while building better-sqlite3. Run pnpm install --ignore-scripts in that case.pnpm -C core bench
Vitest prints one table per group, with the runs per second (hz) and the mean, minimum, maximum and percentiles in milliseconds. The sources are in core/benchmarks.