Skip to content

Improve Git performance in large repositories - #63456

Open
aaravrav wants to merge 1 commit into
zed-industries:mainfrom
aaravrav:improve-git-panel-large-repos
Open

Improve Git performance in large repositories#63456
aaravrav wants to merge 1 commit into
zed-industries:mainfrom
aaravrav:improve-git-panel-large-repos

Conversation

@aaravrav

Copy link
Copy Markdown

Objective

  • Improve Git responsiveness in very large repositories such as nixpkgs.
  • Prevent branch switching from waiting for expensive filesystem-driven repository refreshes.
  • Prevent loading large commit histories from making the UI choppy or unresponsive.

Solution

  • After a branch checkout succeeds, update Zed’s repository state immediately and notify anything observing it. This avoids waiting for a filesystem event and removes an extra Git command that was previously needed to rediscover the active branch.
  • When more than 100 paths change at once, refresh Git status from the repository root instead of processing every path individually. This prevents branch switches in large repositories from triggering thousands of incremental status updates.
  • Keep at most one commit-history batch queued at a time and give the UI an opportunity to run between batches. This prevents a large history load from overwhelming the foreground thread.
  • Load commit history only after the History tab is opened instead of preloading it while the user is viewing Changes.
  • As history batches arrive, request and append only the newly available commits instead of rebuilding the entire list.
  • When drawing the history list, process only the visible rows instead of copying every loaded commit.

Testing

  • Tested branch switching and large commit-history loading manually with the nixpkgs repository on my linux machine
  • Verified that branch switching completes promptly and the History tab remains responsive while loading many commits.
  • Ran the relevant branch-switching, commit-history, and path-coalescing tests.
  • I didn't test other platforms. Reviewers can test by opening a large repository like nixpkgs, switching branches, and loading a long commit history.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Improved Git panel responsiveness and branch switching in large repositories.

@cla-bot

cla-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @aaravrav on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 30, 2026
@aaravrav

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot

cla-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @aaravrav on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot

cla-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@aaravrav

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 30, 2026
@cla-bot

cla-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@ChristopherBiscardi ChristopherBiscardi added the area:integrations/git Git integration feedback label Aug 31, 2026
@ChristopherBiscardi ChristopherBiscardi added the area:performance Feedback for performance issues, speed, memory usage, etc label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:integrations/git Git integration feedback area:performance Feedback for performance issues, speed, memory usage, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants