Skip to content

perf: Implement atomic Grid Body updates via explicit suspension flag #8989

@tobiu

Description

@tobiu

Context

Changing multiple configs that affect the view (e.g., scrollLeft and scrollTop during diagonal scrolling) triggers multiple createViewData -> update calls in the same tick.

Solution

  1. ScrollManager: Consolidate the DOM updates into a single, atomic operation using syncGridBody.
  2. Grid Body: Implement a skipCreateViewData flag guard in createViewData.

Changes

  1. Refactor ScrollManager:
    • Create syncGridBody (throttle: 16ms) in delayable.
    • Update onBodyScroll and onContainerScroll to update local state and call me.syncGridBody().
    • Implement syncGridBody to use the suspend/resume pattern:
      this.gridBody.skipCreateViewData = true;
      this.gridBody.set({scrollLeft, scrollTop});
      this.gridBody.skipCreateViewData = false;
      this.gridBody.createViewData();
  2. Modify Grid Body:
    • Add if (me.skipCreateViewData) return; to createViewData.

Expected Result

Smoother diagonal scrolling and reduced update() cycles on the Grid Body, without the latency of buffering.

Metadata

Metadata

Assignees

Labels

aicoreCore framework functionalityenhancementNew 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