# git_ui: Batch merge conflict anchor resolution \(\#63394\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ff020dd053069891d8e747e34d344858ce29425e

Requested commit: ff020dd053069891d8e747e34d344858ce29425e

Commit: ff020dd053069891d8e747e34d344858ce29425e

Tree: 628a656691ff95aec8f5d161f6c55aa6c41cbc25

Author: Conrad Irwin

Committer: GitHub

## Message

```
git_ui: Batch merge conflict anchor resolution (#63394)

Improves merge-conflict loading by resolving ordered conflict anchors
with a single excerpt sweep instead of restarting the excerpt scan four
times per conflict.

The pull request also adds `script/generate-merge-conflict-benchmark`,
which creates validated small, medium, or severe repositories with real
unresolved Git merges.

On the severe workload (128 files × 256 conflicts), anchor conversion
decreased from 483.5 ms to 5.9 ms, saving about 478 ms, or roughly 5% of
the total refresh.

Closes
https://linear.app/zed-industries/issue/FR-174/improve-git-panel-performance-for-large-merge-conflicts

## Testing

- `cargo test -p multi_buffer
test_ordered_buffer_anchor_ranges_to_anchor_ranges`
- `cargo test -p git_ui conflict`
- `./script/clippy -p multi_buffer -p git_ui`
- Generated and validated the small synthetic merge-conflict workload

Release Notes:

- Improved performance when opening large merge conflicts
```

## Parents

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

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