Files
oak-gpui/crates
Max Brunsfeld 7788eabec0 Avoid performance bottlenecks from git status calls during worktree scanning (#2777)
Closes
https://linear.app/zed-industries/issue/Z-2689/huge-slowdown-when-working-in-large-git-repositories-like-webkit
Closes https://github.com/zed-industries/community/issues/1770

In large git repositories (like Webkit), `git status` can be very slow.
And our current approach of retrieving git statuses (one by one as we
load paths), causes catastrophic slowdowns in these repos. This PR
further optimizes our retrieval of git statuses (started in
https://github.com/zed-industries/zed/pull/2728), so that when scanning
a directory, we only load git statuses once, in a single batch, at the
beginning of the scan.

There is still an initial lag when opening `WebKit` in Zed, while the
initial git status runs. But once this call completes, everything is
fast. Let's come back to this problem later.

For now, this makes Zed's directory scanning massively more efficient,
even in the case of normal-sized repos like `zed`. The git status code
was a huge percentage of zed's CPU usage when launching. Here is that
code, highlighted in a flamegraph before and after this change:

Before:

![before](https://github.com/zed-industries/zed/assets/326587/627012f2-6131-44ac-95c2-ea4a4531cb24)

After:

![after](https://github.com/zed-industries/zed/assets/326587/a11a3e1b-e925-4bff-a421-ea71cb4de85d)


Release Notes:

- Fixed a bug where project paths took a very long time to load when
working in large git repositories
([#1770](https://github.com/zed-industries/community/issues/1770))
2023-07-21 14:46:53 -07:00
..
2023-07-17 12:49:59 -06:00
2023-07-20 16:10:20 -04:00
2023-07-18 12:32:53 -04:00
2023-07-14 16:09:02 -07:00
2023-07-22 00:17:02 +03:00
2023-02-27 12:06:10 -08:00
fmt
2023-07-19 12:34:56 -07:00
2023-06-02 22:02:19 -04:00
2023-06-02 22:02:19 -04:00
2023-06-29 22:25:49 +03:00
2023-06-29 22:39:33 +03:00
2023-06-02 22:02:19 -04:00
2023-06-30 22:03:21 +03:00
2023-06-22 18:06:52 +02:00