Skip to content

Conversation

@Dakota-LM
Copy link

Added Roslyn configuration options to be better optimized for large repos. In particular, the dotnet_analyzer_diagnostics_scope and the dotnet_compiler_diagnostics_scope are set to OpenFiles, so they aren't trying to run across the entire project all at once. Added caching for json set in the transform_settings_for_roslyn function, which was generating a new json every few seconds to check for changes, causing bloated memory over time.

Disclaimer: I made this PR to solve an issue I'm currently facing. However, I am not completely proficient in Rust, so this was mostly built using GitHub copilot and some well-engineered prompts. I've tested it in Zed (both Preview and Nightly) after a cargo build --release and it does seem to solve the issue of Zed hanging after Roslyn has been running too long on Windows. That said, please feel free to make improvements if anything stands out.

repos. Added caching for json set in the transform_settings_for_roslyn
function, which was generating a new json every few seconds to check for
changes, causing bloated memory over time.
@cla-bot
Copy link

cla-bot bot commented Jan 16, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @Dakota-LM on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@Dakota-LM
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Jan 16, 2026
@cla-bot
Copy link

cla-bot bot commented Jan 16, 2026

The cla-bot has been summoned, and re-checked this pull request!

@MrSubidubi MrSubidubi changed the title Performance optimizations for Windows Tweak default configuration to be more performant on Windows Jan 17, 2026
Copy link
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

You usually don't have to build Zed yourself for this, installing as a dev extension should be sufficient.

I'll probably defer the review of the tweaked defaults to someone else, however, quick question regarding the Roslyn setting transformation: I do not think this should be causing any issues. I do see your comment on this

which was generating a new json every few seconds to check for changes, causing bloated memory over time.

but this should not be polled every few seconds but only once when starting the language server and I doubt this is causing any memory bloat. Also, with the caching, you will be unable to tweak your settings when Zed is already running, which we obviously do not want.

Can you elaborate on the memory bloating a bit more perhaps?

@Dakota-LM
Copy link
Author

@MrSubidubi I'll try. I do have an issue in, which may or may not be related, it's the only thing I really noticed in the logs.
#44

Basically the behavior on Windows, in my experience, is that Zed gets incrementally slower and slower until the GUI is non-responsive and I have to force quit the application. This only occurs when I have the csharp language server running with Roslyn. If I use omnisharp, I don't have any issues. Other language servers I installed from the Zed marketplace also don't seem to get the same results. At first I thought just the OpenFiles switch to the config might do it, but no luck. So Copilot suggested the json thing, and it sped things up, but I guess with side-effects I wasn't aware of. Note, this is on both Preview and Nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants