# editor: Reduce redundant invalidations \(\#56234\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 593a78d3ffa348d98358f61588e6d99e56c0db87

Requested commit: 593a78d3ffa348d98358f61588e6d99e56c0db87

Commit: 593a78d3ffa348d98358f61588e6d99e56c0db87

Tree: d14f93ced0c14b73887cf3c7807ec6cfd3f8955f

Author: Mikhail Pertsev

Committer: GitHub

## Message

```
editor: Reduce redundant invalidations (#56234)

So, I am building the "GPUI re-render devtools" in [this
branch](https://github.com/zed-industries/zed/pull/55825)

And while running the new devtools I found a few low-risk
over-invalidation sources and included the easy fixes here:

- Avoid notifying for sticky headers when the computed sticky header
result has not changed.
- Avoid repeated `cx.notify()` calls while overscrolling at the top of
the editor when the scroll position is clamped.
- Give `Button::loading` a keyed animation id so repeat animation frame
requests can be attributed to the concrete loading button instance.

The attached video shows the workflow I used to find these with the new
devtools.


https://github.com/user-attachments/assets/852c64a9-ae91-4878-bbf8-21cc23763c42


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:

- N/A
```

## Parents

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

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