Perf: confine 20 Hz playback invalidation to leaf views; trim per-render waste - #119
Merged
Merged
Conversation
Audit part 4 — pixel-identical UI, less recomputation: - The Now Playing sheet's transition section read transitionProgress and secondsUntilTransition (both derived from the 20 Hz position writes) inline, re-evaluating the ENTIRE sheet 20x/s whenever it was open. Extracted into a TransitionSection leaf view — same subtree, same transitions — so only the leaf re-evaluates. - TransitionVisualizationView computed TransitionPreview.make on every access (3x+ per frame during live blends); now computed once at init. - SearchView dropped its @query (which hydrated every Track including beatTimes and kept a live subscription while search was open) for a one-shot title/artist-only fetch. - The custom keyboard's suggestion bar is a leaf view, so keystrokes stop rebuilding the ~40-button key grid. - UpNextView captures upcomingTracks once per body (it allocates a fresh slice per access and was read twice). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
sanylax0
approved these changes
Jul 20, 2026
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.
Part 4 of the CPU/memory audit — SwiftUI render churn. Pixel-identical UI, strictly less recomputation.
transitionProgressandsecondsUntilTransition— both derived from the 20 Hzpositionwrites — inline in the sheet body. Result: the entire sheet (artwork tile, labels, scrubber, transport, chips) re-evaluated 20×/s whenever it was open during playback, and throughout every blend. Extracted verbatim into aTransitionSectionleaf view, same subtree and.transition(.opacity), so only the leaf re-evaluates — the same isolation pattern already used for the progress ring / scrubber / mini-player line.TransitionVisualizationViewrecomputedTransitionPreview.make(...)on every property access (3×+ per frame during live blends); it's a pure function of the init inputs and is now computed once at construction.SearchViewdropped its@Query— which hydrated everyTrack(beat grids included) and held a live subscription re-firing on any library change while search was open — for a one-shot fetch of justtitle/artist.UpNextViewcapturesupcomingTracksonce per body (fresh array allocation per access, previously read twice).Device check
🤖 Generated with Claude Code
https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
Generated by Claude Code