Skip to content

Make satisfying-sort animation ~3x faster (sort pass only)#318

Merged
drob merged 3 commits into
mainfrom
speed-up-satisfying-sort
Jul 20, 2026
Merged

Make satisfying-sort animation ~3x faster (sort pass only)#318
drob merged 3 commits into
mainfrom
speed-up-satisfying-sort

Conversation

@drob

@drob drob commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Speeds up the detail satisfying-sort sort pass by ~3x, leaving the green completion finale untouched.

What changed

The sort pass speed is driven by sort_delay_ms(), which derives a per-step sleep from the SPEED constant. The green finale is driven separately by GREEN_SPEED, so it's unaffected. I bumped SPEED from 20 to 82.

Why 82 and not a clean "divide by 3": each step also has a fixed render cost, so wall-clock time is not linear in the step delay — dividing the sleep by 3 only got to ~2.36x. I tuned SPEED by measurement so the step delay lands at ~9ms, which produces a real ~3x end-to-end speedup.

Verification (measured in a terminal via PTY)

Pass Before After Ratio
Sort pass 9870 ms 3311 ms 2.98x faster
Green finale ~1186 ms ~1186 ms unchanged ✅

cargo test passes (19 satisfying-sort tests), build is warning-free, and a final smoke run of the built binary renders and exits cleanly with no panics.

View in Indent View in Slack
Tag @indent to continue the conversation here.


Open in Devin Review

@aviator-app

aviator-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@drob
drob temporarily deployed to integration-tests July 17, 2026 06:46 — with GitHub Actions Inactive

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

Comment thread src/commands/satisfying_sort/mod.rs Outdated
Comment on lines +28 to +30
// Per-step render cost is fixed, so wall-clock speed scales sub-linearly with the
// derived step delay; SPEED is tuned by measurement (82 => ~9ms/step) rather than
// picked for a clean fraction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@indent could you remove this comment and make a memory not to leave excessive / train-of-thought comments like this one?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — removed the comment in a97547b, so the diff is now just the one-line SPEED change. The rationale lives in the PR description instead. And noted the preference: I'll keep comments minimal and skip train-of-thought explanations going forward.

@indent
indent Bot temporarily deployed to integration-tests July 17, 2026 07:47 Inactive
@drob
drob enabled auto-merge (squash) July 17, 2026 07:47
…visories

Co-Authored-By: Sachin Iyer <siyer@detail.dev>
@drob
drob merged commit a13a65b into main Jul 20, 2026
14 checks passed
@drob
drob deleted the speed-up-satisfying-sort branch July 20, 2026 23:07
@indent

indent Bot commented Jul 20, 2026

Copy link
Copy Markdown
PR Summary

Generating summary...

Issues

Review closed.

CI Checks

1 CI check failed on cc10154.

Failing Security Audit
  • Security Audit finished with failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant