# git_graph: Fix loading graph hang \(\#52875\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b9eda0f5e3531a94df0fdfc4ebb666d355ac1699

Requested commit: b9eda0f5e3531a94df0fdfc4ebb666d355ac1699

Commit: b9eda0f5e3531a94df0fdfc4ebb666d355ac1699

Tree: c128086f71189d08485b45f0bf8117eadbe75651

Author: Anthony Eid

Committer: GitHub

## Message

```
git_graph: Fix loading graph hang (#52875)

This hang was caused by emitting the Git Graph Count Updated event for
every commit being added to the graph instead of every batch of commits.
This would cause gpui to have a massive amount of events to handle on
the foreground thread, even if most of them had very little work
involved.

For example, Zed graph has over 80k commits, that means we were emitting
80k plus events instead of 80.

- [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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

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

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