Skip to content

perf(tui): reduce hot path allocations#485

Merged
kkyosuke merged 1 commit into
mainfrom
usagi/review
Jun 29, 2026
Merged

perf(tui): reduce hot path allocations#485
kkyosuke merged 1 commit into
mainfrom
usagi/review

Conversation

@kkyosuke

Copy link
Copy Markdown
Owner

Summary

  • Make issue CLI progress calculations overflow-safe by scaling in u128 before division.
  • Make TUI progress bar scaling overflow-safe for pathological counts or widths.
  • Add regression tests for counts near usize::MAX.

Why

The review found a theoretical overflow risk in progress calculations that multiplied usize values before dividing. In debug builds this can panic for huge counts; in release builds it can wrap. Normal project sizes are unaffected, but using a wider intermediate type removes the hazard without changing visible output.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --quiet — 1835 passed

@github-actions

Copy link
Copy Markdown

📊 Test Coverage

🚀 いまのカバレッジ (Lines): 100.00% — この調子でいこう!

🎉✨ パーフェクト!全ファイル Lines カバレッジ 100% を達成しました 🏆🐰

@kkyosuke kkyosuke marked this pull request as ready for review June 29, 2026 01:50
@kkyosuke kkyosuke merged commit 1718db8 into main Jun 29, 2026
3 checks passed
@kkyosuke kkyosuke deleted the usagi/review branch June 29, 2026 01:50
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