Skip to content

Implement Hybrid Cell Buffering (Pooling) for Grid Rows #8992

@tobiu

Description

@tobiu

Problem

The current Neo.grid.Row implementation generates cell IDs based on the column dataField. During horizontal scrolling, this causes DOM nodes to be destroyed and created as they enter/exit the viewport.

This constant allocation/deallocation creates memory pressure (GC pauses) during rapid scrolling.

Solution: Hybrid Cell Pooling

Implement a pooling strategy to reuse cell containers.

1. Pooled Cells (Recycled)

  • Target: Columns with hideMode: 'removeDom'.
  • Mechanism: Fixed pool of cell containers (IDs: ...__cell-0, ...__cell-1).
  • Behavior: Recycle cells by updating style.left, cls, and content.
  • Impact on Child Nodes:
    • Text/Homogeneous Content: If the new column has the same structure (e.g. plain text or same HTML structure), the inner nodes are also reused/updated. Zero GC.
    • Heterogeneous Content: If the new column has a different structure, the inner nodes will be swapped by the VDOM engine. We still save the allocation of the heavy Cell Container (div.neo-grid-cell) and its layout positioning.

2. Permanent Cells (Stateful)

  • Target: Columns with hideMode: 'visibility' (e.g., Sparklines).
  • Mechanism: Keep data-bound IDs (...__firstname).
  • Behavior: Persist in DOM; toggle visibility.

Implementation Details

  • Neo.grid.Body: Implement getCellId(rowIndex, dataField) to handle pooled/permanent lookups.
  • Neo.grid.Row: Refactor createVdom for the hybrid pass.

Goal

Eliminate GC-induced micro-stutters by ensuring O(1) stability for the Grid Structure (Cell Containers).

Metadata

Metadata

Assignees

Labels

aienhancementNew feature or requestperformancePerformance improvements and optimizations

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions