Skip to content

Reactivity performance improved for user_input and heartbeat handler#1505

Merged
Greg-Orca merged 2 commits into
stablefrom
SUKU-serial-worker-thread
Jun 2, 2026
Merged

Reactivity performance improved for user_input and heartbeat handler#1505
Greg-Orca merged 2 commits into
stablefrom
SUKU-serial-worker-thread

Conversation

@SukuWc
Copy link
Copy Markdown
Member

@SukuWc SukuWc commented Jun 2, 2026

No description provided.

SukuWc and others added 2 commits June 1, 2026 17:08
Incoming serial EVENT messages were triggering synchronous Svelte
re-renders across 14 subscriber components on every hardware event,
costing 5–20ms per message on the main thread.

Introduce RAF batching in process_incoming_event_from_grid: computed
values are staged in a plain JS field and flushed to the store once
per animation frame, decoupling the serial ingestion rate from the
render rate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add RuntimeNode.batch() static: suppresses notifyParent() cascade
  during construction, replacing ~64 re-renders per module connect with 1
- Add _stageHeartbeat() RAF deferral to GridRuntime: defers rot/portstate/
  memorystat field writes to next frame instead of synchronously on each heartbeat
- Keep aliveModules.update() synchronous for accurate isAlive() timing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Visit the preview URL for this PR (updated for commit 8b17d24):

https://grid-editor-web--pr1505-suku-serial-worker-t-5z4g63mt.web.app

(expires Thu, 02 Jul 2026 07:26:20 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2b65ba6ef19c55d367eaffd04e46bcde25305d6f

@SukuWc SukuWc moved this to Ready for QA in Editor Roadmap Jun 2, 2026
@Greg-Orca Greg-Orca moved this from Ready for QA to QA in progress in Editor Roadmap Jun 2, 2026
@Greg-Orca Greg-Orca merged commit 36f44fb into stable Jun 2, 2026
15 of 20 checks passed
@Greg-Orca Greg-Orca moved this from QA in progress to Done in Editor Roadmap Jun 2, 2026
@narayb
Copy link
Copy Markdown
Collaborator

narayb commented Jun 2, 2026

Feels similar to the old version, even on slower computers. During testing I haven't noticed problematic slowdowns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants