Skip to content

git_ui: Avoid blocking main thread during stage/unstage#47806

Merged
Veykril merged 1 commit intozed-industries:mainfrom
marcocondrache:avoid-ui-block-with-stages
Mar 18, 2026
Merged

git_ui: Avoid blocking main thread during stage/unstage#47806
Veykril merged 1 commit intozed-industries:mainfrom
marcocondrache:avoid-ui-block-with-stages

Conversation

@marcocondrache
Copy link
Copy Markdown
Contributor

@marcocondrache marcocondrache commented Jan 27, 2026

With a large number of files in the git status, pressing stage/unstage could cause a noticeable freeze. The async performance profiler showed that the task spawned inside change_all_files_stage blocked the main thread for 300ms+, resulting in a clear and visible UI stall. The main cause was the need to traverse all entries to determine what to stage or unstage, which becomes expensive for large change sets.

Same repro as: #47800

Release Notes:

  • Improved latency of stage/unstage operations

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 27, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Jan 27, 2026
@marcocondrache marcocondrache force-pushed the avoid-ui-block-with-stages branch from 2475833 to d28c8aa Compare January 27, 2026 21:31
@marcocondrache marcocondrache marked this pull request as ready for review January 27, 2026 21:32
@marcocondrache marcocondrache changed the title git_ui: Avoid blocking UI during stage/unstage git_ui: Avoid blocking main thread during stage/unstage Jan 27, 2026
@JosephTLyons JosephTLyons requested a review from kubkon January 27, 2026 22:00
@Veykril Veykril assigned Veykril and unassigned kubkon Mar 17, 2026
Copy link
Copy Markdown
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge (squash) March 17, 2026 07:15
@marcocondrache
Copy link
Copy Markdown
Contributor Author

@Veykril I think somebody needs to approve the CI

@Veykril Veykril closed this Mar 18, 2026
auto-merge was automatically disabled March 18, 2026 05:59

Pull request was closed

@Veykril Veykril reopened this Mar 18, 2026
@Veykril Veykril enabled auto-merge (squash) March 18, 2026 05:59
@Veykril Veykril merged commit 0c9b8fd into zed-industries:main Mar 18, 2026
23 checks passed
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 20, 2026
…es#47806)

With a large number of files in the git status, pressing stage/unstage
could cause a noticeable freeze. The async performance profiler showed
that the task spawned inside `change_all_files_stage` blocked the main
thread for 300ms+, resulting in a clear and visible UI stall. The main
cause was the need to traverse all entries to determine what to stage or
unstage, which becomes expensive for large change sets.

Same repro as: zed-industries#47800

Release Notes:

- Improved latency of stage/unstage operations
AmaanBilwar pushed a commit to AmaanBilwar/zed that referenced this pull request Mar 23, 2026
…es#47806)

With a large number of files in the git status, pressing stage/unstage
could cause a noticeable freeze. The async performance profiler showed
that the task spawned inside `change_all_files_stage` blocked the main
thread for 300ms+, resulting in a clear and visible UI stall. The main
cause was the need to traverse all entries to determine what to stage or
unstage, which becomes expensive for large change sets.

Same repro as: zed-industries#47800

Release Notes:

- Improved latency of stage/unstage operations
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.

4 participants