Skip to content

⚡ Bolt: [Optimization] Shallow-compare keys in setLiveValues to reduce store churn - #1066

Draft
ford442 wants to merge 3 commits into
mainfrom
bolt-setlivevalues-shallow-compare-5281643322792912222
Draft

⚡ Bolt: [Optimization] Shallow-compare keys in setLiveValues to reduce store churn#1066
ford442 wants to merge 3 commits into
mainfrom
bolt-setlivevalues-shallow-compare-5281643322792912222

Conversation

@ford442

@ford442 ford442 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

💡 What: Added a shallow equality check inside AutomationStore.setLiveValues to verify if incoming values actually differ from the existing state before performing an Object.assign and notifying subscribers.

🎯 Why: setLiveValues is called frequently (on every 16th-note step via useStepHandler). 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 unnecessary requestAnimationFrame notifications 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

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>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e9f78448-1175-4ff6-9ea2-4a73cf1a46ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

google-labs-jules Bot and others added 2 commits August 5, 2026 01:56
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>
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.

1 participant