Fix some overcomputation in the project diff - #57859
Merged
Merged
Conversation
- don't emit unnecessary edited events from the multibuffer - await initial conflicts parse when opening a conflict set for the first time - make the project diff subscribe to conflicts directly instead of indirecting through the editor - limit excerpt recomputation in the project diff when diffs or conflicts change
cole-miller
force-pushed
the
improve-conflicts-performance
branch
from
June 4, 2026 18:15
ca68c12 to
3f81cbe
Compare
cole-miller
enabled auto-merge
June 4, 2026 21:46
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
- Don't emit unnecessary edited events from the multibuffer when setting excerpts is a no-op - Limit excerpt recomputation in the project diff when diffs or conflicts change to just the affected buffer - Ignore diff events in the project diff that can't affect excerpt boundaries Also includes some drive-by improvements to the handling of merge conflicts: - Await initial conflicts parse when opening a conflict set (like diffs), so we don't see an initial incorrect "no conflicts" state - Make the project diff subscribe to conflicts directly instead of indirecting through the editor (also like diffs) - Instead of saving the affected buffer when resolving a conflict, just avoid re-registering dirty buffers with the project diff, so that excerpts for conflicts don't disappear quite so eagerly (once more: like diffs) The combination of these changes greatly cuts down the amount of time spent syncing the `DisplayMap`, which is especially bad for the split view. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved the performance of the project diff, especially in the presence of merge conflicts - Fixed conflicts disappearing too quickly from the project diff when editing - Fixed conflicts sometimes taking a while to appear in the project diff during large merges
Anthony-Eid
reviewed
Jun 9, 2026
| for buffer in buffers { | ||
| open_conflict_set_for_buffer(editor, buffer, cx); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Would there even be more than one buffer if it's a singleton buffer? Seems like it would be simpler to do something like buffer.read(cx).as_singleton...
Member
Author
There was a problem hiding this comment.
Yep, forgot to clean this up when I changed conflict handling for multibuffers, thanks!
Contributor
|
@zed-zippy approve |
Contributor
|
@zed-industries/approved |
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
- Don't emit unnecessary edited events from the multibuffer when setting excerpts is a no-op - Limit excerpt recomputation in the project diff when diffs or conflicts change to just the affected buffer - Ignore diff events in the project diff that can't affect excerpt boundaries Also includes some drive-by improvements to the handling of merge conflicts: - Await initial conflicts parse when opening a conflict set (like diffs), so we don't see an initial incorrect "no conflicts" state - Make the project diff subscribe to conflicts directly instead of indirecting through the editor (also like diffs) - Instead of saving the affected buffer when resolving a conflict, just avoid re-registering dirty buffers with the project diff, so that excerpts for conflicts don't disappear quite so eagerly (once more: like diffs) The combination of these changes greatly cuts down the amount of time spent syncing the `DisplayMap`, which is especially bad for the split view. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved the performance of the project diff, especially in the presence of merge conflicts - Fixed conflicts disappearing too quickly from the project diff when editing - Fixed conflicts sometimes taking a while to appear in the project diff during large merges
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
- Don't emit unnecessary edited events from the multibuffer when setting excerpts is a no-op - Limit excerpt recomputation in the project diff when diffs or conflicts change to just the affected buffer - Ignore diff events in the project diff that can't affect excerpt boundaries Also includes some drive-by improvements to the handling of merge conflicts: - Await initial conflicts parse when opening a conflict set (like diffs), so we don't see an initial incorrect "no conflicts" state - Make the project diff subscribe to conflicts directly instead of indirecting through the editor (also like diffs) - Instead of saving the affected buffer when resolving a conflict, just avoid re-registering dirty buffers with the project diff, so that excerpts for conflicts don't disappear quite so eagerly (once more: like diffs) The combination of these changes greatly cuts down the amount of time spent syncing the `DisplayMap`, which is especially bad for the split view. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Improved the performance of the project diff, especially in the presence of merge conflicts - Fixed conflicts disappearing too quickly from the project diff when editing - Fixed conflicts sometimes taking a while to appear in the project diff during large merges
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.
Also includes some drive-by improvements to the handling of merge conflicts:
The combination of these changes greatly cuts down the amount of time spent syncing the
DisplayMap, which is especially bad for the split view.Self-Review Checklist:
Release Notes: