gridcn2.0.0
Performance

Row limits

Look up how many rows one grid scrolls, from the 100,000-row test size to the browser height limits in Firefox and Chromium.

The browser limits how tall an element can be. The scroll height of a grid is the header and pinned-row bands plus the row count times the row height. The test suite scrolls 100,000 rows. Past that count, the height limits below decide.

LimitValueWhat happens past it
Portable scroll height17.8 million pxBelow it, Firefox and Chromium both scroll the whole grid.
FirefoxAbout 17.9 million px (inferred, not measured here)The element gets a height of 0. The grid has no scroll range.
ChromiumAbout 33.5 million pxThe height stops growing. The rows past the limit are out of reach.
Rendered rows without a bounded height200The grid caps the rows that it mounts.
Server row count10,000,000useDataGridServerRows clamps a larger totalRowCount, and a sequential source stops loading.

Scroll height limit

To stay under both limits, keep the row count times the row height below 17.8 million px. The count that matters is the number of rows of the view: the sorted and filtered list, rendered or not. A scroll-mode source that reports totalRowCount shows that many rows, so the same limit applies to that count.

The table gives the row count at which each limit starts, for the three densities. The Firefox column uses the portable limit of 17.8 million px:

DensityRow heightFirefox: no scroll range aboveChromium: rows out of reach past
compact28 pxAbout 635,000 rowsAbout 1,198,000 rows
default36 pxAbout 494,000 rowsAbout 932,000 rows
comfortable44 pxAbout 404,000 rowsAbout 762,000 rows

The table rounds the counts down. A smaller row height allows more rows. A larger row height allows fewer. The table covers Firefox and Chromium. Test the other engines that you ship to.

The next sample checks a row count against the portable limit:

const PORTABLE_HEIGHT_PX = 17_800_000;

export function fitsPortableHeight(rows: number, rowHeight = 36): boolean {
  return rows * rowHeight <= PORTABLE_HEIGHT_PX;
}

Development warning

If the row count times the row height passes 17.8 million px, a development build logs one warning per grid. The warning names row counts rounded down to two significant digits. Its Firefox count comes from the portable limit. At 36 px it names about 490,000 rows for Firefox and about 930,000 for Chromium. Production builds log nothing.

Rendered rows

Virtualization mounts only the rows in view. If the grid has no bounded height, the grid mounts at most 200 rows. A development build warns once when the viewport covers more than 200 rows. See Give the grid a bounded height.

Go past the limit

To show more rows than one grid scrolls, show fewer rows at once. Page the rows with server pagination or narrow the view with a filter. Keep the rest of the data on the server. For rows in memory, page the view with defaultPageSize. See Client pagination.

On this page