⚡ Bolt: [Optimization] Shallow-compare keys in setLiveValues to reduce store churn - #1066
⚡ Bolt: [Optimization] Shallow-compare keys in setLiveValues to reduce store churn#1066ford442 wants to merge 3 commits into
Conversation
Adds a shallow equality check inside `AutomationStore.setLiveValues` to early return if the incoming values are identical to the current state. This prevents unnecessary object allocations and React re-renders when the transport clock ticks without any actual automation changes. Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds a shallow equality check inside `AutomationStore.setLiveValues` to early return if the incoming values are identical to the current state. This prevents unnecessary object allocations and React re-renders when the transport clock ticks without any actual automation changes. Also fixes Emscripten 3.1.51 export extraction which produced spaces around the `=` operator, causing `extract_wasm_export_map.mjs` to omit exports. Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
Adds a shallow equality check inside `AutomationStore.setLiveValues` to early return if the incoming values are identical to the current state. This prevents unnecessary object allocations and React re-renders when the transport clock ticks without any actual automation changes. Also fixes Emscripten 3.1.51 export extraction which produced spaces around the `=` operator, causing `extract_wasm_export_map.mjs` to omit exports. Co-authored-by: ford442 <9397845+ford442@users.noreply.github.com>
💡 What: Added a shallow equality check inside
AutomationStore.setLiveValuesto verify if incoming values actually differ from the existing state before performing anObject.assignand notifying subscribers.🎯 Why:
setLiveValuesis called frequently (on every 16th-note step viauseStepHandler). Previously, it unconditionally created a new merged object and updated the state reference, causing React components subscribed to the store to re-render, and generating unnecessaryrequestAnimationFramenotifications even when automation values were static.📊 Impact: Reduces React store update churn and main-thread object allocations during sequencer playback when automation lanes are active but values are not actively changing at that specific step.
🔬 Measurement: Verify by playing back a sequence with static automation lanes. Observe reduced React profiler commit frequency for components subscribed to
liveAutomatedValues. Tests and linters pass cleanly.PR created automatically by Jules for task 5281643322792912222 started by @ford442