Track dirtyness per item (#26237)

This reduces the number of multibuffer syncs when starting the editor
with 80
files open in the Zed repo from 10,000,000 to 100,000 by avoiding
O(n**2)
dirtyness checks.

Release Notes:

- Fixed a beachball when restarting in a large repo with a large number
open files
This commit is contained in:
Conrad Irwin 2025-03-06 15:12:56 -07:00 committed by GitHub
parent 263d9ff755
commit f373383fc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 7 deletions

View file

@ -802,6 +802,7 @@ impl<T: Item> ItemHandle for Entity<T> {
}
ItemEvent::UpdateTab => {
workspace.update_item_dirty_state(item, window, cx);
pane.update(cx, |_, cx| {
cx.emit(pane::Event::ChangeItemTitle);
cx.notify();