LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 18, 2026, 11:32 PM
updatedAtNov 19, 2026, 3:06 AM
githubUrlhttps://github.com/neomjs/neo/issues/21407
authorneo-opus-ada
commentsCount0
parentIssue20874
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 19, 2026, 3:06 AM

A Gantt re-projects its links once per row of a store batch

Closed v14.0.0/archive-v14-0-0-chunk-4 bugaiperformance
neo-opus-ada
neo-opus-ada commented on Nov 18, 2026, 11:32 PM

Context

Found while profiling #21356 (2,000 tasks, 1,972 links). After an edit, that example sets each zone and phase it touched to its children's span, writing the 104 parents as one store.updateRows() batch. Moving the first task by one day (its cascade moves all 1,895 successors) then took 514 ms to settle. With the fix below it settles in 97 ms, the time it takes without the batch. Each figure is the median of 3 runs: headless Chromium 159, devmode, Apple M5 Max, timed in the page by requestAnimationFrame.

The Problem

Neo.data.Store#updateRows() writes a batch as one change. Each record in the batch publishes recordChange with isBatch: true, then one rowsChange closes the batch (#20968, #20974). Neo.grid.Body#onStoreRecordChange leaves isBatch rows to that single pass.

Neo.gantt.Container does not. Its task-store listener (afterSetStore()) runs syncDependencyLayer() once for every record in the batch. Each sync re-projects every link: Neo.gantt.DependencyLayer#project() walks the visible tasks and all links. Its dependency-store listener (afterSetDependencyStore()) does the same for a batch of link edits. So a batch of n rows costs n full projections.

Reproducer: a unit case moves two tasks in one updateRows() call. On dev 0b8d66fa17 it projects the links twice (Expected 1, Received 2).

The Architectural Reality

  • src/data/Store.mjs: updateRows() and its rowsChange event. The event's fields are field names.
  • src/grid/Body.mjs: the rowsChange: me.onStoreRowsChange binding and the isBatch early return in onStoreRecordChange(). This is the pattern to follow.
  • src/gantt/Container.mjs: the listeners in afterSetStore() and afterSetDependencyStore(). moveTask()'s own cascade is already one sync, because _movingTask suppresses the per-record ones.

The Fix

  • In afterSetStore(), the record-change handler returns early on isBatch, and rowsChange is bound to that handler. It already accepts field names.
  • In afterSetDependencyStore(), changed returns early on isBatch, and rowsChange is bound to it.
  • Added in review (RA-1 of PR #21408): a batch can also reapply an opted-in filter or sort before its rowsChange, and those events carry no batch mark. Neo.data.Store therefore gets a read-only isUpdatingRows, true from the batch's first write until its rowsChange. Both Gantt listeners return while it is true, which replaces the isBatch checks.

Acceptance Criteria

  • A task-store batch of several rows re-projects the links once, and the routes show the new dates (unit).
  • A dependency-store batch re-projects once too (unit).
  • The Gantt unit specs stay green.

Out of Scope

Windowing the link layer vertically, a cheaper projection, and the example's roll-up itself (#21356).

Related

Parent #20874 · found by #21356 · the store batch: #20968, #20974 · Neo.grid.Body#onStoreRowsChange

Owned: the fix and its red-first unit case are ready, so no contributor labels.

Live latest-open + closed sweep: latest 20 open read at 2026-11-18T22:31Z (78 open, red band, so filed under the family epic #20874). Open search ("gantt dependency layer batch", "updateRows rowsChange"); closed search ("gantt dependency layer re-project", "updateRows rowsChange batch"): #20985, #20974, #21029 and #21135 read. The Out of Scope of #20974 leaves "other recordChange consumers" open. No equivalent. A2A in-flight sweep: latest 30 messages, all read states, no claim on the Gantt or store batches. MC sweep ("Gantt links redrawn once per changed row, a bulk edit re-projects the arrows each time"): no prior decision. Own-assignment sweep: 7 open, none overlapping.

Decision Record impact: none.

Retrieval Hint: "Gantt store batch updateRows re-projects the dependency links once per record, isBatch rowsChange"

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code