LearnNewsExamplesServices
Frontmatter
id8559
titleOptimize TimelineCanvas data load delay
stateClosed
labels
enhancementaiperformance
assigneestobiu
createdAtJan 11, 2026, 11:39 PM
updatedAtJan 11, 2026, 11:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/8559
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 11, 2026, 11:42 PM

Optimize TimelineCanvas data load delay

Closed v11.20.0 enhancementaiperformance
tobiu
tobiu commented on Jan 11, 2026, 11:39 PM

The current implementation of TimelineCanvas.onTimelineDataLoad introduces a fixed delay (50ms for resize, 100ms for load) to wait for DOM updates before calculating node positions. This delay is unnecessary when the DOM is already ready (e.g., navigating between tickets where the list structure persists).

This ticket tracks the optimization to remove the initial delay for the first attempt, relying on the existing retry mechanism with a backoff delay for subsequent attempts if the DOM is not yet ready.

Proposed Change: Change:

let delay = isResize ? 50 : 100;

To:

let delay = attempt === 0 ? 0 : 50;

This ensures instant updates when possible while maintaining robustness for async DOM updates.

tobiu added the enhancement label on Jan 11, 2026, 11:39 PM
tobiu added the ai label on Jan 11, 2026, 11:39 PM
tobiu added the performance label on Jan 11, 2026, 11:39 PM
tobiu referenced in commit e7cdfcf - "perf: Remove initial delay in TimelineCanvas data load (#8559)" on Jan 11, 2026, 11:41 PM
tobiu assigned to @tobiu on Jan 11, 2026, 11:41 PM
tobiu
tobiu Jan 11, 2026, 11:41 PM

Input from Gemini 3 Pro:

✦ I have optimized the onTimelineDataLoad method in TimelineCanvas.mjs.

Changes:

  • Removed the fixed 50ms/100ms delay for the initial attempt.
  • The logic now attempts to calculate positions immediately (0ms delay) on the first try (attempt === 0).
  • If the DOM is not ready (nodes not found), the existing retry logic kicks in with a 50ms backoff for subsequent attempts.

This change ensures that navigation between tickets (where the DOM is often already ready or updates are fast) feels instant, while maintaining robustness for slower DOM updates.

tobiu added parent issue #8398 on Jan 11, 2026, 11:42 PM
tobiu closed this issue on Jan 11, 2026, 11:42 PM