perf: optimize CaDecon iteration hot paths#107
Merged
Conversation
Batch SolidJS signal updates (400 reactive traversals → 1 per iteration), replace deep copies with shallow snapshots, eliminate double-copied worker payloads, use pre-allocated typed arrays instead of push(...spread), hoist invariants out of inner loops, and replace Math.min/max(...) with manual loops to prevent stack overflows on large arrays. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a ResizableGrid component with drag handles at the column divider, row divider, and center intersection. Drag to resize; double-click to reset to default 1/3 + 2/3 column and 50/50 row split. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Performance optimizations
batch()+bulkUpdateTraceResults): 400 reactive graph traversals per iteration → 1, the highest-impact changesnapshotIteration: eliminates ~3.2MB of deep-copied typed arrays per iteration (safe becauseTraceResultEntryobjects are replaced, never mutated)buildDispatch: transferjob.tracedirectly instead of allocating a copy (~1.6MB saved per iteration)dispatchKernelJobs: two-pass approach replacespush(...spread)which risked stack overflow for >65k samplescell/rowBaseoutside innerpxloop, inlinedataIndex, remove unused import (~3M fewerMath.floor+ function calls at 2x DPR)Math.min/max: manual loop preventsRangeErrorfor arrays >65k elementsDraggable grid resizer
ResizableGridcomponent wrapping the 2x2 plot layoutTest plan
npm run typecheckpasses (only pre-existing errors in unrelated files)npm run buildsucceeds🤖 Generated with Claude Code