Skip to content

Reduce TUI zero-state animation CPU usage - #14604

Merged
kevinyang372 merged 1 commit into
masterfrom
kyang/optimize-tui-zero-state-animation
Jul 31, 2026
Merged

Reduce TUI zero-state animation CPU usage#14604
kevinyang372 merged 1 commit into
masterfrom
kyang/optimize-tui-zero-state-animation

Conversation

@kevinyang372

Copy link
Copy Markdown
Member

Description

Reduces the CPU cost of the TUI zero-state animation while preserving its original 66 ms (~15 FPS) visual cadence.

  • Suspends animation repaint scheduling while the terminal is unfocused and resumes immediately on focus gain.
  • Caches logo geometry, reuses projection buffers, and paints the starfield directly.
  • Replaces generic stack composition in the zero state with a specialized direct compositor while preserving opaque-overlay semantics.
  • Adds production-shaped Criterion benchmarks and rendering/focus regression coverage.

At 120×40, the retained-frame benchmarks improved by approximately 68% for the built-in logo and 73% for the ASCII logo. Larger terminal sizes showed greater savings.

Implementation plan: https://staging.warp.dev/drive/notebook/NHie0i2bcU6ge5gHne0EEC

Linked Issue

None.

Testing

  • Manually tested the TUI locally with ./script/run-tui
  • cargo nextest run -p warpui_core --features tui --no-fail-fast (559 passed, 7 skipped)
  • cargo nextest run -p warp_tui --features test-util --no-fail-fast (947 passed)
  • cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings
  • cargo clippy -p warp --all-targets --tests -- -D warnings
  • cargo clippy -p warp_completer --all-targets --tests -- -D warnings
  • ./script/format --check
  • git diff --check

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-TUI: Reduced CPU usage while the zero-state animation is active.

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@kevinyang372

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss 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.

Overview

This PR reduces TUI zero-state animation CPU usage by retaining logo projection buffers, painting the starfield directly, replacing the generic zero-state stack with a specialized compositor, and suspending timed repaints while the terminal is unfocused.

Concerns

  • For this user-facing TUI change, please attach terminal visual evidence demonstrating the zero-state still renders correctly and focus pause/resume works end to end. Per repo guidance, acceptable TUI evidence is a terminal transcript, a render_to_lines / TuiBuffer::to_lines snapshot diff, or a ./script/run-tui capture; the PR currently lists manual testing but does not attach a capture.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@kevinyang372
kevinyang372 force-pushed the kyang/optimize-tui-zero-state-animation branch from 9f6d3c7 to e720f0b Compare July 31, 2026 20:30

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kevinyang372
kevinyang372 requested a review from moirahuang July 31, 2026 21:42
@kevinyang372
kevinyang372 merged commit b462e01 into master Jul 31, 2026
28 checks passed
@kevinyang372
kevinyang372 deleted the kyang/optimize-tui-zero-state-animation branch July 31, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants