Repository navigation
Project Synesthesia effects without allocating per point - #797
Merged
Merged
Conversation
…s without allocating
Contributor
Exports Benchmark✅ No significant change · 4 within noise · 98 compared
Changed packages
All 98 cases
Within noise (4): past the threshold, but the runs overlap
I/O-bound, not judged (1)These cases touch the filesystem, so their time follows the OS cache and the disk more than the code.
Excluded: too fast to time (10)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.
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.
Summary
drawPointCloudcomputes the cloud's scale, yaw/pitch cosines and camera basis once per cloud and projects each point withprojectCloudPointIntointo a reused result, instead of building four intermediate vectors per point.renderBombcomputes the spin's cosine and sine once per bomb and projects its fountain and skirt grains withburstParticlePositionInto/projectYawedIntointo reused results.particleRiverPointIntoandprojectViewIntowith the frame's camera basis instead ofparticleRiverPoint→viewPoint→projectPointwith object spreads.drawSchooltakesproject(out, point)and keeps six scratch results, so the mantas' six projections per fish no longer allocate; both callers project throughprojectViewInto.projectPoint(viewPoint(rotateX(rotateY(…)))),burstParticlePosition,projectPoint(rotateY(…))andparticleRiverPointover random inputs.Measurements
Node micro-benchmark, same inputs:
Browser, unminified build, dense 8-key stress chart on AUTO with Synesthesia, mean
requestAnimationFramecallback time over 10 s (≈1200 frames), three alternating runs:Test plan
pnpm run checkpnpm test(7203 passed)🤖 Generated with Claude Code