feat: completion-order streaming (Branch 1 — kill head-of-line delay)#32
Draft
rsanheim wants to merge 1 commit into
Draft
feat: completion-order streaming (Branch 1 — kill head-of-line delay)#32rsanheim wants to merge 1 commit into
rsanheim wants to merge 1 commit into
Conversation
The sticky-footer printer buffered finished rows behind the alphabetically-earliest unfinished repo, so on a big fetch the first row could lag ~7s behind the first completion (first_print_ms=9794 vs first_exit_ms=2432) and a finished repo could wait up to 10s to appear. TtyTablePrinter now streams each repo's row the moment it finishes, tracking printed rows by index instead of a contiguous cursor. On ~/work status under a PTY: delayed_repos 98 -> 11, max_ordered_wait_ms 1592 -> 1, first_print_ms 771 -> 225 (= first_exit_ms), total_ms unchanged. Non-TTY / redirected output is untouched: PlainPrinter keeps its deterministic alphabetical order, so pipes and scripts stay stable.
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.
Branch 1 of 2 in the "make fetch feel fast" divide-and-conquer. This one evolves the sticky-footer printer; the sibling branch (
rjs/git-all-tty-ratatui) explores a full ratatui TUI.Stacked on the Phase 1 branch (
rjs/git-all-ui-feedback-c07c9b, PR #31) so the diff here is just the completion-order delta: one file (printer.rs) + the doc.Problem
The trace on
git-all fetchover 104 repos exposed the real cause of "feels slow": the printer buffered finished rows behind the alphabetically-earliest unfinished repo.first_exit_ms=2432— first fetch finishes at 2.4s (network floor)first_print_ms=9794— but the first row didn't appear until 9.8smax_ordered_wait_ms=10637— worst repo waited 10.6s to display after finishingSo repos were completing but the screen looked stuck for ~7s. (No wall-clock regression —
statusbenched identical to main, 3.85s vs 3.87s.)Change
TtyTablePrinternow streams each repo's row the moment it finishes, tracking printed rows by index instead of a contiguous cursor. The live scrollback is in completion order; the pinned footer (counts, clock, in-flight list) is unchanged.Non-TTY / redirected output is untouched —
PlainPrinterkeeps deterministic alphabetical order, so pipes and scripts stay stable.Results (
~/work statusunder a PTY)first_print_msdelayed_reposmax_ordered_wait_mstotal_msVerified
cargo testgreen (updated the buffering test to assert completion order), clippy/fmt clean. Driven under tmux withscript/tty-lab— mid-run, a slow early repo (activities) is still in the footer's running list while six later-alphabetical repos have already streamed to scrollback. Clean rendering, no scrollback garble.