Repository navigation
perf(gui): target refreshes after push, pull, and fetch - #50
Open
HiFiveJazz wants to merge 9 commits into
Open
HiFiveJazz wants to merge 9 commits into
HiFiveJazz wants to merge 9 commits into
Conversation
HiFiveJazz
force-pushed
the
perf/targeted-push-refresh
branch
from
October 12, 2026 03:57
ce79f77 to
9fdf274
Compare
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.
Summary
Avoid full repo refreshes after successful push, pull, and fetch operations when only a subset of the model can have changed.
Instead:
Fetch-and-checkout and unrelated remote operations keep the existing full refresh behavior where HEAD/worktree state may have changed.
Why
Remote operations often set
needs_refresh = true, which schedules a full repo refresh, which is expensive especially on big projects that use git like the Linux Kernel, leaving a lot performance to be desired.The goal here is to keep the existing Git CLI architecture, but make refreshes operation-specific instead of blindly reloading the whole model.
Benchmarks
All Linux kernel measurements below were taken against the same checkout/configuration using
strace.Push
Using a local repo as the push target so the benchmark mostly isolates lazygitrs refresh work:
This optimizes the refresh work performed after
git pushcompletes.Pull
The targeted pull refresh reduced the post-pull command set from:
The improvement comes from avoiding unrelated model reloads afterward.
The follow-up tag optimization also removes the remote tag discovery work that still remained in the targeted pull path:
git remotegit ls-remote --tags <remote>per configured remoteWith three configured remotes, that removed another 4 Git commands from the traced operation, though there are more ways to optimize pull still that I'm looking into.
Fetch
The targeted fetch path refreshes only branches, commits, remotes, and tags.
The raw
git fetchitself is unchanged; this measures the refresh workperformed after it completes.
Background Auto-fetch
When periodic auto-fetch reports that refs changed, it now reuses the same targeted fetch refresh instead of scheduling a full model refresh.
This reduces recurring background work while lazygitrs is left open.
Correctness
cargo fmt --checkpassesgit diff --checkpasses