Skip to content

git_ui: Avoid cloning repository snapshot when rendering Git graph - #66180

Merged
SomeoneToIgnore merged 2 commits into
zed-industries:mainfrom
RemcoSmitsDev:git-graph-reduce-clones-in-render-function
Oct 26, 2026
Merged

SomeoneToIgnore merged 2 commits into
zed-industries:mainfrom
RemcoSmitsDev:git-graph-reduce-clones-in-render-function

Conversation

@RemcoSmitsDev

Copy link
Copy Markdown
Collaborator

Summary

While looking into some performance issues with larger repositories, I noticed that we call the method snapshot inside the commit details & ref label render function, that clones the whole snapshot even though we only need to know the branch name. So we don't have to own/know the whole snapshot/state, so we can avoid doing this by using the deref reference of the repository snapshot.

Testing

I tested that it still shows the right branch, which it should. Because we still point to the same value, but we just skip a clone per ref label that is inside the git graph :).

Self-review

  • I've reviewed my diff for quality, security, reliability, and performance.
  • UI changes follow the checklist.
  • Tests cover the new or changed behavior.

Release Notes:

  • Improved Git graph rendering performance by avoiding unnecessary repository state clones.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Oct 26, 2026
@zed-community-bot zed-community-bot Bot added the community champion Issues filed by our amazing community champions! 🫶 label Oct 26, 2026
@SomeoneToIgnore SomeoneToIgnore self-assigned this Oct 26, 2026
@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue Oct 26, 2026
Merged via the queue into zed-industries:main with commit 57c7b10 Oct 26, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants