Skip to content

perf: memoize canvas hot-path selection and connector lookups#39

Merged
charlesrhoward merged 1 commit intomainfrom
codex/feat-27-canvas-hot-path-memoization
Feb 21, 2026
Merged

perf: memoize canvas hot-path selection and connector lookups#39
charlesrhoward merged 1 commit intomainfrom
codex/feat-27-canvas-hot-path-memoization

Conversation

@charlesrhoward
Copy link
Contributor

@charlesrhoward charlesrhoward commented Feb 21, 2026

Summary

  • memoize selected-element derivation used by PropertiesPanel and ActionsMenu
  • build an element lookup map for render-time connector anchor lookup
  • replace repeated elements.find(...) IIFE work with memoized connector anchor values

Validation

  • pnpm build

Closes #27


Note

Low Risk
Pure client-side performance refactor that preserves behavior but changes render-time derivation paths for selection and connector preview anchors.

Overview
Improves canvas render performance by memoizing selected-element derivation used by PropertiesPanel and ActionsMenu, avoiding repeated filter/includes work on each render.

Also replaces per-render elements.find(...) IIFEs for connector preview anchors with a memoized elementById map and computed connectorPreviewAnchor, reducing connector drag hot-path lookups.

Written by Cursor Bugbot for commit a5d836e. This will update automatically on new commits. Configure here.

@charlesrhoward charlesrhoward enabled auto-merge (squash) February 21, 2026 21:24
@vercel
Copy link

vercel bot commented Feb 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drawit Ready Ready Preview, Comment Feb 21, 2026 9:44pm

Request Review

@charlesrhoward charlesrhoward force-pushed the codex/feat-27-canvas-hot-path-memoization branch from daac7a4 to a5d836e Compare February 21, 2026 21:44
@charlesrhoward charlesrhoward merged commit 3b5d823 into main Feb 21, 2026
4 checks passed
@charlesrhoward charlesrhoward deleted the codex/feat-27-canvas-hot-path-memoization branch February 21, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance: Memoize hot-path canvas selection/lookups

1 participant