Reactivity performance improved for user_input and heartbeat handler#1505
Merged
Conversation
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>
|
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 |
Collaborator
|
Feels similar to the old version, even on slower computers. During testing I haven't noticed problematic slowdowns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.