# Remove expensive-to-clone fields from worktree's LocalSnapshot \(\#2497\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d7d29472c216a612f631290593efce2175f0ea59

Requested commit: d7d29472c216a612f631290593efce2175f0ea59

Commit: d7d29472c216a612f631290593efce2175f0ea59

Tree: 66ad81ab8eaa427b4ae7b173b01dbf0ccaca648c

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Remove expensive-to-clone fields from worktree's LocalSnapshot (#2497)

This fixes performance problems that @nathansobo and I have seen in some
cases, when a large number of files changed on disk. A lot of time was
being spent in `worktree::LocalSnapshot::clone`. I think this may have
been because of needing to clone the `removed_entry_ids` map. This
structure is only really used when *mutating* the `LocalSnapshot` in the
background scanner, so I moved it off of the snapshots.
```

## Parents

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

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

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