-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Editor constantly freezing in a large Rust codebase #19022
Comments
This report is not actionable without profile sample(s) or at least the repository in question + the sequence of actions to reproduce this. |
@SomeoneToIgnore I'd be happy to provide a profile sample! But I can't share the repository. Is there a guide on how to best profile Zed on macOS? |
Thanks for the guide, I'll go through this in a couple of hours. Should I build Zed with debug symbols or are you good with the latest release? |
Good point, I expect it to be fine but you can also try the |
I'm seeing the same thing. It happened for me when I split my monorepo into a workspace with multiple crates. The project isn't huge, 15k loc in 110 files. I'm refactoring a lot of code and now whenever I break something (e.g. I change the function signature in a trait) and enter the diagnostics window, Zed hangs for a while. I suspect this is related to #18658 and I also recall seeing a (fixed) bug in the issue tracker that relates to the order of operations when saving files and Zed/LSP polling for changed files? |
On my end, apologies for not getting back to this sooner. I've changed quite a few things in my Zed setup, and I'm no longer running into this issue. I will update this thread once I can reproduce the issue consistently. |
Hey @SomeoneToIgnore! I recorded two runs: one of them has small hangs, and the other has Zed completely frozen for a while (probably forever, but I killed it after 10 minutes). The heaviest stack trace is Here's the trace: https://www.icloud.com/iclouddrive/05bETfxUb_6jBA3BiGfGexrDw#Zed_Hangs Let me know if you need me to upload it somewhere else. GitHub unfortunately won't accept it as it's 48MB. EDIT: Recorded a third run with a forever hang: https://www.icloud.com/iclouddrive/027klYrmex898JZFKbbyrq1jw#Zed_Hangs_2 |
I'm seeing the same thing, the AnyWeakModel::upgrade call hangs Zed. Not indefinitely, but long enough for me to kill and restart most times. Here's another trace: |
We only have one crate any only a medium sized repository and I get hangs aswell. Rust analyser + Zed borking out edit: I think for me this was related to disk also running out of space |
Thank you, there seems to be a collection of issues, I see at least two, but all somehow related to diagnostics. Here's one from the long hangs, I won't cover it yet, as most of the comments around wanted to look at The
zed/crates/gpui/src/app/entity_map.rs Lines 489 to 514 in d95a4f8
Such "fundamental" calls being "slow" on the profile usually indicate some hot loop around it. zed/crates/diagnostics/src/diagnostics.rs Lines 195 to 200 in d95a4f8
I think this is a good place to inspect further, and the profile cannot lead us further, so we need to compile Zed and debug (or use
But that means, when things get slow you have the diagnostics panel open? Are things better without it being open? Assuming that the diagnostics panel is open and, we need to check out how |
Yes, I think this is linked to the diagnostics panel in most cases for me. It's not the only diagnostics-panel related issue I'm seeing, it may be related to #19019. I have between 100 and 600 diagnostic issues active at all time, depending on what part of my project I'm currently looking at. |
And that sounds like |
How can I help? I don't expect I'll have time to dive into Zed internals to figure out what's going wrong on my end, but I'd be happy to run a test build and try to repro the issue. |
Unfortunately, not sure there's another way except debugging around that method or sharing a project so someone else can debug around. |
Just in case it helps, here's a another trace recorded on linux during what looks like the exact same freeze, while working on a relatively small rust project. I believe I just pressed I to go into insert mode with vim mode. My project only had 5 warnings at the time, with the diagnostics panel open in another hidden tab. Cannot share the project unfortunately. I have v0.159.0 installed. |
I have (unfortunately) been able to reproduce this issue consistently in this project: https://github.com/jorikvanveen/web-meteen with Zed 0.157.5 on NixOS (full system config can be found on my github page). It takes about 5 minutes of jumping around and editing random stuff before problems start to occur. No clue if its related but I am using vim keybinds as well. I'm on a decently modern Intel laptop with 32GB of ram and plenty of free storage, let me know if more details are needed. |
I have been using Zed the whole day and I did not have a single freeze since disabling vim mode. It could be a coincidence, but usually I would get one freeze per hour at the very least. |
@plichard I'm not using vim mode so its probably not the sole cause of the freezes. |
Heads-up, there's #18658 which seems to be very close to this issue. |
Related to: #19022 Release Notes: - Improve editor performance with large # of diagnostics. --------- Co-authored-by: Conrad <[email protected]> Co-authored-by: Conrad Irwin <[email protected]>
A fix for this issue is available in latest Preview (0.161.0) build. Check it out and see if it fixes the issue for you. |
Check for existing issues
Describe the bug / provide steps to reproduce it
I'm trying out Zed again today after a few months of going back to VS Code because of usability issues with Zed.
We have a very large codebase consisting of some 360 Rust crates (+ about the same amount of Swift and Kotlin code). I'm seeing constant freezes in the editor, where the macOS beach ball appears, and I can't click anywhere or do anything while Zed finishes whatever it's doing.
These freezes usually last from 5s to a minute.
I just had one where Zed was hogging 100% CPU, and I had to kill it after 5 minutes of not responding.
Unfortunately, this, alongside the other reported issues, make Zed completely unusable for us. These might be regressions, as I don't recall hitting nearly as many freezes the last time I attempted to switch to Zed.
Environment
Zed: v0.156.1 (Zed)
OS: macOS 14.6.1
Memory: 32 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
These were the last logs before Zed froze. I often see these so I don't think they're related.
The text was updated successfully, but these errors were encountered: