[3/4] TUI: reuse retained text measurements - #14585
Conversation
3fc0958 to
ef8aa9b
Compare
cb13209 to
ec59dc4
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ec59dc4 to
e424b6e
Compare
ef8aa9b to
b177932
Compare
e424b6e to
2695304
Compare
e28b54b to
d96944a
Compare
|
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 Powered by Oz |
There was a problem hiding this comment.
Overview
This PR caches TuiText natural measurements by width and skips viewport selection snapshot allocation when there is no active selection and line-end trimming is disabled.
Concerns
- The
TuiTextmeasurement cache can remain populated across measurement-affecting builder calls, allowing a later layout at the same width to reuse a stale wrapped/truncated natural size.
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
harryalbert
left a comment
There was a problem hiding this comment.
nice. warpy comment seems potentially real but other than that LGTM
ef90a56 to
bdcbe6f
Compare
bdcbe6f to
daea0c6
Compare

Description
Stack 3 of 4. Reuses
TuiTextnatural measurements when retained content is laid out again at the same width, and avoids copying a viewport selection snapshot when there is no active selection and line-end trimming is disabled.This layer targets steady-state frame overhead after stack PR 2 has already bounded paint work. Width changes still recompute text measurement, and selection snapshots remain enabled whenever selection or trimmed line-end behavior needs them.
Benchmark at 120×50 versus stack PR 2:
The next stack layer removes the remaining repeated streaming-height work and owns auto-scroll reconciliation.
Stack: #14575 ← #14582 ← 3/4 →
oz/tui-streaming-height-reconciliation.Agent conversation: https://staging.warp.dev/conversation/2b6af7be-b227-4b20-aaf4-23c9a8494b81
Stack plan: https://staging.warp.dev/drive/notebook/yM2YcQsILFsFzwixBDbD9p
Performance plan: https://staging.warp.dev/drive/notebook/LHzsFd1B8XbQ8AnUqB88LS
Linked Issue
N/A — Warp Agent CLI retained-frame performance.
Testing
cargo nextest run -p warpui_core --features tui— 555 passed, 7 skipped.cargo nextest run -p warp_tui— 902 passed.Strict Clippy passed for
warpui_core --features tuiandwarp_tui --features test-util.cargo bench -p warp_tui --features test-util --bench transcript_bench./script/formatSigned-in 120×40 tmux PTY: zero state and unsent input repainted correctly.
I have manually tested my changes locally with
./script/run-tuiAgent Mode
CHANGELOG-NONE