Benchmark results
See what the scroll and view rebuild tests measure, the thresholds each one enforces, and the measured sort speed.
The repository pins scroll speed with tests in real Chromium. The scroll tests mount a grid with 100,000 rows and drive the scroll by script. This page lists the thresholds the tests enforce. A threshold is a limit. If a run crosses it, the test fails. A threshold is not a measurement.
Your hardware, your cells, and the load on your machine change the frame times. Run the benchmark to get numbers for your setup.
Test setup
The frame-rate suites mount DataGrid 600 px high and 1200 px wide with nine columns. The cells are text, number, and checkbox. One number column has a currency format. The drag suites use 360 px by 1200 px with five columns of text and number cells. The keyboard tests use 1,000 rows. The tests load the real stylesheet, because layout and scroll must be real for frame timing to mean anything.
Thresholds
| Suite | What it does | Pass when |
|---|---|---|
| Full swap against idle | Scrolls 8 px per frame, then 800 px per frame, which is more than one viewport. Takes the best of three samples. | The ratio of the two frame rates is at least 0.06. The full-swap rate is at least 15 fps, or 8 percent of the idle rate, whichever is lower. |
| Long tasks in a fast scroll | Scrolls 240 px per frame for 240 frames, like a fast flick of the wheel, and counts main-thread tasks over 50 ms. | Total long-task time is under 200 ms. On CI the limit is 20,000 ms. |
| Jump sequence | Jumps to 0, 75, 50, 90, 10, and 100 percent of the scroll height, 250 ms apart. | The longest frame is under 1,000 ms. At most 20 frames pass 50 ms. Long-task time is under 2,000 ms. |
| Blank rows after a drag | Drags the scrollbar with random deltas of 200 to 1,500 px. | No row is missing once the scroll settles. |
| One-row step | Scrolls exactly one row height. | The entering row renders, with one row of slack: at most two renders per column. |
| Mounted rows | Scrolls a fast burst, then waits. | The mounted row count returns to its idle size after the scroll settles. |
The thresholds sit below a healthy run. They catch a collapse, not a small slowdown.
View rebuild thresholds
A unit test builds the view of 100,000 rows in Node, with no rendering. It times each sort and filter step:
| Step | Pass when |
|---|---|
One contains text filter | Under 200 ms |
Three filters joined with and | Under 400 ms |
Three filters in an or group | Under 300 ms |
An isAnyOf filter and an or group of two filters | Under 300 ms |
isBetween on a number and a date column | Under 400 ms |
isAnyOf and isNoneOf on a number and a date column | Under 400 ms |
| A sort on three columns | Under 1,000 ms |
| A filter and a sort together | Under 700 ms |
On CI, the sort, the isAnyOf and isNoneOf, and the combined limits are twice as high. No test pins the mount time of the grid.
Sort speed
The client sort turns each sort column into one integer key per row and sorts the keys. scripts/bench-sort.mjs measured the sort step on one development machine at 100,000 rows. On unsorted input, a number column took 4 to 7 ms. That is 7.7 to 15 times faster than the comparator sort (a sort that calls a compare function for each pair of rows). A text column took 5 to 93 ms, 2 to 9 times faster. A text column with mostly unique strings gains the least.
On input that is already sorted or reversed, a number column took 9 ms, 1.9 times faster. A text column took 21 to 22 ms, 1.2 to 1.5 times faster. The full run is in research/perf-sort-1m.md. Your hardware changes these numbers.
Some columns still use the slower comparator sort. They are a column with sortCompare and a cell type with its own compare. A number column with NaN, infinite values, values above 1e300, or text uses it too. So does a text column with values that are not strings. A view of fewer than 256 rows uses it too.
Logged output
The suites also print what they measure. With --reporter=verbose, the jump sequence prints a jump-sequence line under its test name. The line holds this object on one line:
{
"longestFrameMs": 16.799999999999272,
"framesOver33": 0,
"framesOver50": 0,
"longTaskMs": [],
"maxRowsRendered": 21
}That line is one run on one development machine. Your run differs. The full-swap suite logs perf ratio with both frame rates. The fast-scroll suite logs perf long-tasks with the count and total time. If the ratio falls below 0.15, or any long task occurs, the suite prints a warning. The test still passes.
Related
- Run the benchmark: run the suites yourself
- Performance guidance: keep scrolling smooth
- Virtualization: what the grid mounts
- Row limits: the browser height limits