# Fix some overcomputation in the project diff \(\#57859\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8612c626d9df6bdd98f19426d2a5498e2679b034)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8612c626d9df6bdd98f19426d2a5498e2679b034

Requested commit: 8612c626d9df6bdd98f19426d2a5498e2679b034

Commit: 8612c626d9df6bdd98f19426d2a5498e2679b034

Tree: 74deda0383963dde9f0a9108c02b58114eb33e42

Author: Cole Miller

Committer: GitHub

## Message

```
Fix some overcomputation in the project diff (#57859)

- 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
```

## Parents

- [c40629d1a1352cf00a476218c151bb8c66c8f8fb](https://git.cafe/gitcafe/zed/commit/c40629d1a1352cf00a476218c151bb8c66c8f8fb?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8612c626d9df6bdd98f19426d2a5498e2679b034?format=markdown)
