Repository navigation
Performance tuning: PMS playable randomizer and built-in skin particles - #796
Merged
Merged
Conversation
…ne subsets Every impossible chord has three lanes and a permutation is a bijection, so a chord's image contains one exactly when one of its three-lane subsets maps onto it: the search checks those subsets against a 512-entry table. It runs as one loop that records the valid permutations' ordinals, and the pick replays the order to the chosen one, so the same permutation is picked (an equivalence test keeps the previous search as the reference).
…cle layers once per frame Pixi's Particle renders from its packed color alone; the tint setter parsed a Color for every point every frame. The layer also looked up its index among its siblings twice on every point; once per frame is enough.
…ch second The view timed its sections under ?perf but never ended a frame, so nothing was printed and the samples piled up.
Contributor
Exports Benchmark🔴 6 regressions · 3 improvements · 15 within noise · 699 compared
Regressions (6)
Improvements (3)
Changed packages
All 309 cases
Within noise (15): past the threshold, but the runs overlap
…and 3 more. I/O-bound, not judged (6)These cases touch the filesystem, so their time follows the OS cache and the disk more than the code.
Excluded: too fast to time (61)A timed sample lasted 1 µs or less on at least one side (usually a base commit from before calls were batched), so its time is timer noise and no change is shown.
…and 49 more. Run details
|
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.
Performance pass over
devel, measured before changing anything.How it was measured
pnpm run bench, 918 cases) to rank the slowest calls.requestAnimationFrametiming,?perfsection timing and Chrome performance traces (unminified build, CPU profile aggregated by function).What the play loop spends
Before the change the frame loop used ~25 % of the main thread; the note judging and the shared playfield passes were ~0.1 ms a frame. Nearly all of it was Synesthesia's effects:
Changes
randomizePMSPlayableLanes), the slowest benchmark case by 4×.pixi-kit/particle-layer.ts).Particlerenders from its packedcolor, and thetintsetter parsed aColorfor every point every frame. The layer now writes the packed color directly, computed as Pixi computes it (tested against Pixi's own values).tint/alphagetters are no longer kept in step; nothing reads them.?perfon the built-in play view now prints its per-second section summary. It timed sections but never ended a frame, so samples piled up unreported.Left as is
scrollHeighton its interval, about 0.5 %.Testing
Particle; the colour test now asserts the layer never uses the setters.pnpm run check(0 errors),pnpm test(7199 passed).🤖 Generated with Claude Code