Skip to content

v0.61.0 PR feature adds ~600ms overhead per refresh (10x regression, no opt-out) #5506

@Aayush9029

Description

@Aayush9029

Description

v0.61.0 introduced GitHub PR integration (#2781). On every startup and after every background fetch, lazygit now makes two GitHub GraphQL round-trips to fetch PR data. This adds ~600ms of overhead per refresh cycle — a 10x regression in post-fetch refresh time compared to v0.59.0.

There is no config option to disable this feature. It auto-activates if gh auth login has been run, which is true for most developers.

Reproduction

# Clone this repo (public, verifiable)
git clone https://github.com/jesseduffield/lazygit.git /tmp/lazygit-bench
cd /tmp/lazygit-bench
gh repo set-default jesseduffield/lazygit

# Run with debug logging
LOG_LEVEL=info lazygit --debug

# In another terminal, tail the log:
# tail -f ~/Library/Application\ Support/lazygit/development.log | grep -E "Fetched|Refresh took|git fetch"

Measurements

Methodology: ran each version in tmux with --debug flag, let it fully initialize for 8 seconds, killed the session, then extracted durations from lazygit's own debug log (~/Library/Application Support/lazygit/development.log). 3 sequential runs per version on the same machine, tested on this repo.

v0.61.0 (current)

Run PR fetch #1 PR fetch #2 Final refresh
1 330ms (5 PRs) 264ms 506ms
2 359ms (5 PRs) 240ms 522ms
3 302ms (5 PRs) 431ms 696ms

v0.59.0 (baseline, no PR feature)

Run PR fetch Final refresh
1 N/A 58ms
2 N/A 56ms
3 N/A 57ms

Post-fetch refresh: ~575ms (v0.61.0) vs ~57ms (v0.59.0) — 10x slower.

Also confirmed on two private repos. The overhead is consistent (~250-350ms per GraphQL round-trip, 2 round-trips per refresh cycle) regardless of repo size or number of PRs returned.

Root cause

From the debug logs, the startup sequence is:

  1. Initial async refresh → PR fetch Pressing space without any changes crashes lazygit #1 (GraphQL call, ~300ms)
  2. git fetch --all completes → triggers sync refresh including pullRequests scope → PR fetch Correct gocui link #2 (~250ms)

The GraphQL round-trip is the bottleneck — even when fetching only 5 PRs, each call takes 250-430ms due to network latency. This runs on every refresh, not just startup.

Additionally, if remote.origin.gh-resolved is not set (which it isn't by default unless you run gh repo set-default), the PR fetch still takes ~300ms to fail and returns 0 PRs.

Suggestions

  1. Add a config toggle (e.g. git.showPullRequests: false) — the original PR had one (enableGithubCli) but it was removed during review.
  2. Cache PRs aggressively — skip re-fetching if the last fetch was < N seconds ago, especially on the post-git fetch refresh.
  3. Don't fetch PRs if gh-resolved is not set — currently spends ~300ms failing silently.

Environment

  • lazygit: v0.61.0 (Homebrew)
  • macOS 26.4 (Apple Silicon, arm64)
  • git 2.50.1 (Apple Git-155)
  • gh 2.89.0
  • Terminal: Ghostty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions