WarUI

DOM pooling and cell recycling

GRID-A06-F04P0baselinePlanned

Row and cell elements that leave the rendered range go back to a pool and are reused for incoming rows, instead of being destroyed and recreated. This reduces garbage collection pressure and layout cost. The demo exposes pool statistics so developers can verify recycling.

Planned. This page shows the specification from issue #183. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

500,000 rows, recycling on. A stats panel shows created, reused, and pooled counts for rows and cells.

Expected behavior

With recycling on, the created count plateaus after the first screen while the reused count grows. With recycling off, the created count grows continuously. Exceeding poolSizeLimit trims spare nodes.

Planned API surface

domRecyclingpoolSizeLimitgetPoolStats()onPoolStatsChange

Acceptance criteria

  • After the initial render, scrolling the full dataset creates no new row elements while the viewport size is unchanged (recycling on). (pending)
  • Recycled elements have no stale attributes, classes, inline styles or aria values from the previous row. (pending)
  • getPoolStats returns {created, reused, pooled, destroyed} for rows and cells. (pending)
  • The pool is trimmed to poolSizeLimit when the viewport shrinks. (pending)