Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zed crashes and is slow in large code base. #24099

Closed
shirshak55 opened this issue Feb 2, 2025 · 13 comments
Closed

Zed crashes and is slow in large code base. #24099

shirshak55 opened this issue Feb 2, 2025 · 13 comments

Comments

@shirshak55
Copy link

shirshak55 commented Feb 2, 2025

Summary

I cloned chromium source and opened it in zed. It takes lot of time just to show files and folders. Additionally it crashes also.

crash.log

Zed Version and System Specs

Zed 0.171.6
Macos Sequoia 15.3

ScreenFlow.mp4
@osiewicz
Copy link
Contributor

osiewicz commented Feb 2, 2025

Could you share the trace of a crash? The slow loading is somewhat of a known issue, as what's slow in this case is us fetching the git status of all the files in your worktree.
I didn't see it crash though.

@shirshak55
Copy link
Author

@osiewicz I have attached crash.log . Attaching here again.

crash.log

@osiewicz
Copy link
Contributor

osiewicz commented Feb 2, 2025

Ok, sorry, I didn't notice it in the original issue; the crash log seems kinda unrelated to the worktree scanning issue. Does it crash for you in other projects too?

@sam-b-rose
Copy link

Experiencing a similar issue when opening a very large codebase. Looks like several git processes are being launched

Image Image

@osiewicz
Copy link
Contributor

osiewicz commented Feb 5, 2025

@sam-b-rose how much time does running git status at the root of your worktree take?

@shirshak55
Copy link
Author

It takes me 5 seconds, but why is zed waiting for whole git status.

@osiewicz
Copy link
Contributor

osiewicz commented Feb 5, 2025

That's the gist of the issue; it should not be waiting for a git status on the init path. It does so because we store git status alongside other metadata of worktree entries, which means that when we first try to walk your project, we have to wait for git status to create the first full project snapshot.
I bet you that if you were to rename .git to something else (or move it into parent directory and rename it), your project would load nearly instantaneously. Not that it's a solution obviously, but this should just more so confirm what we're seeing.

@shirshak55
Copy link
Author

yea it opens instantly if there is no .git .

@sam-b-rose
Copy link

The .git for my large project was several directories up (outside of the editor workspace). Seems like that could have been part of the issue

@osiewicz
Copy link
Contributor

osiewicz commented Feb 5, 2025

@sam-b-rose yes, that's kinda the same as having the .git within your worktree.
How much time does it take to run git status on your end?

@sam-b-rose
Copy link

I haven't been able to replicate the issue in the large codebase. Currently, the time is pretty short:

git status  0.05s user 0.01s system 83% cpu 0.078 total

SomeoneToIgnore added a commit that referenced this issue Feb 5, 2025
Part of #24099
Part of #23025

Git status checks & updates are still slow for such repos, but those are
now not blocking FS entry population and rescans.

Release Notes:

- Improved project panel's speed in large projects
@SomeoneToIgnore
Copy link
Contributor

#24307 had been merged and I see much faster project panel interactions in chromium repo.
Git status updates are still painfully slow, but at least asynchronous now.

If you can build from source and give it a try, or wait until next Preview version to release with it.

@shirshak55
Copy link
Author

okay thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants