Repository navigation
perf(tui): skip snapshot+draw when idle (LAN-1222 experiment) - #129
Merged
Merged
Conversation
Owner
Author
|
Follow-up on the idle-skip review: redraw is no longer keyed only on session generation plus static input chrome. The loop now builds a Tests cover status expiry, add-target poll, update-check recv, open target-list refresh, and IX |
lance0
force-pushed
the
lancey3/lan-1222-dirty-skip
branch
from
August 23, 2026 19:34
d8338ba to
785438f
Compare
LAN-1222 experiment: bump Session::render_generation on hop_mut/reset and skip snapshot_for_render + terminal.draw when a post-poll RenderFingerprint matches the last frame. Tick rate stays 16ms. Playing replay stays dirty via the progress clock. Clippy 1.98 nits stay on chore/clippy-1.98-nits, not this branch.
The dirty-skip fingerprint relied on hop_mut()/reset_stats() to bump render_generation, but enrichment (rdns/asn/geo/ix), the PMTUD driver, and total_sent all mutate the session under state.write() without going through hop_mut, so their changes stayed off-screen until the next probe bumped the counter — for the whole duration of a pause. Wrap the session lock in SessionLock, whose write guard bumps render_generation on release. Every mutation path now marks the TUI dirty, and a writer that forgets is a compile error rather than a stale frame. The manual bumps in hop_mut/reset_stats become redundant.
lance0
force-pushed
the
lancey3/lan-1222-dirty-skip
branch
from
August 24, 2026 15:27
785438f to
151d9e1
Compare
Resize events were dropped by the Key-only input match, and the frame skip means terminal.draw's autoresize no longer runs every tick, so a resize while nothing else changed left the old layout on screen until the next dirty frame — up to 2s (the rate-limit worker's tick) when paused or in a finished replay. Treat a Resize event as invalidating the last fingerprint so the next tick redraws.
lance0
force-pushed
the
lancey3/lan-1222-dirty-skip
branch
from
August 24, 2026 15:42
70bdf6d to
3eebf8f
Compare
lance0
marked this pull request as ready for review
August 24, 2026 15:49
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.
Skip
snapshot_for_render()+terminal.drawon ticks where nothing changed (LAN-1222).What changes
Session::render_generationis bumped by theSessionLockwrite guard on release, so every mutation path — hop stats, enrichment, PMTUD, pause/reset — marks the TUI dirty. A writer that bypasses the lock is a compile error, not a stale frame.RenderFingerprint(session generation, overlays, theme, status, update banner, replay clock, settings, target input, IX cache status, target-list rows) and skips the snapshot and draw when it matches the last frame.replay_current_ms. A terminal resize invalidates the last fingerprint so the next tick redraws.Measured — docker,
ttl 1.1.1.1, 9 hops, 60s, both binaries in the same network window:Not covered
format_cache_agein the settings modal reads the wall clock at render time, so its "Xm ago" text only refreshes when something else on screen changes.