Repository navigation
perf: cut 60 Hz rework from timeline/triage/scope, fix pill auto-persist, dedup helpers - #63
Merged
Merged
Conversation
…s draw - Pills: filter/sort/id/dirty arrays per cam computed once per pills change instead of per clip per frame - Segment geometry (arrStarts/segBounds), trim projections and audio-start marker positions memoized on their actual inputs - Waveform arr→master projection: reuse column boundaries (one mapXToTime call per boundary instead of two) and cache the last-hit segment for strictly-interior queries - drawRun: shared scratch buffers instead of two Float32Array allocations per run - camStatusByCamId: drop the O(n²) ranges.find Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…op dead code - New src/lib/clamp.ts (clamp / clamp01 / clampSeek) replaces 13 identical local copies across editor, triage and arrange. useAudioMaster keeps its own clampSeek variant (different NaN semantics, hot playback path). - New src/lib/time-format.ts replaces 5 byte-identical M:SS formatTime copies; MonoReadout's MM:SS.ff variant intentionally stays local. - snapTime: non-finite bpm now falls back to 'no grid' instead of returning Infinity. - Remove unused isPreviewEmpty from quantize.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rework in Triage waveform, SidechainScope, ProgramStrip - useAutoPersist: the dirty-check didn't watch state.pills although the patch persists them — a pill move/trim alone was never saved and a refresh lost it. Extracted the check as persistRelevantChanged() (tested, incl. red-check) and added pills. - TriageTimeline: timeToX/xToTime were plain functions (fresh identity per render) sitting in effect deps; the component re-renders on every playhead tick, so the full hi-res waveform redrew 60×/s during playback and the window drag-listeners re-installed per tick. Now useCallback on [viewStartS, pxPerSec]. - SidechainScope: both SVG area paths (columns × sub-samples envelope lookups + arr→master projections) and the beat grid rebuilt on every timelineT tick; now memoized on the window/curve inputs — only the playhead line moves per tick. - ProgramStrip: memo()ed, with stable callbacks + memoized paint-preview from the Timeline, so the strip's DOM (segments, splice tabs, FX tape) no longer reconciles every playback frame. LaneHeader's canReset now reads the precomputed per-cam dirty flags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 10, 2026
Closed
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 cha
6883
racters.
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
Optimization pass across the hot render paths plus one real data-loss fix. No functional changes intended — UI and behavior are identical, the same work just stops being redone every playback frame.
Bug fix
useAutoPersist's dirty-check didn't watchstate.pills, although the persist patch writes them. A pill move/trim alone never scheduled a save, so a refresh lost it. The check is extracted as a testedpersistRelevantChanged()helper (red-checked) and now includes pills.snapTimewith a non-finite BPM returns the input unchanged instead ofInfinity.Performance (all: stop per-frame recomputation of frame-invariant work)
Float32Arrayallocations in the shared waveform engine.timeToX/xToTimewere plain functions in effect deps — with the component re-rendering on every playhead tick, the full hi-res waveform (envelope scan + silence tint included) redrew 60×/s during playback and window drag-listeners re-installed per tick. NowuseCallbackon the view inputs.timelineTtick; now memoized — only the playhead line moves per tick.memo()ed with stable callbacks from the Timeline, so the strip's DOM (program segments, splice tabs, FX tape) no longer reconciles every playback frame.Cleanup
lib/clamp.ts(clamp/clamp01/clampSeek) replaces 13 identical local copies;useAudioMasterkeeps its ownclampSeekvariant (different NaN semantics, hot playback path).lib/time-format.tsreplaces 5 byte-identicalformatTimecopies (MonoReadout's MM:SS.ff variant intentionally stays local).isPreviewEmptyfrom quantize.ts.Verification
tscclean.🤖 Generated with Claude Code