Windows - better setup?

Ok - I’ll try not to rant - but I find Visual Studio to be mostly unusable now, and I’m wondering what I can do to make it work better.

I hit build and it takes (not exaggerating) 10-12 minutes to build a plugin (the same plugin takes maybe 1 minute on mac - where I do most of my programming).

While building, VisualStudio seems to lock the message thread (the mouse freezes, any video or audio I am playing skips or stops). It will hang like this for 30 seconds, perhaps give me the “application has stopped responding, close/wait”) message. I wait … it comes back, then freezes again, etc.

When it gets to the linking part of the process, it has to load symbols from a seemingly infinite number of windows libraries, which also locks the message manager. This part is maybe 3 minutes.

Once built, I can change small parts of the code and get a rebuild in semi-reasonable time.

It will surprise nobody to know that when I bought this computer a few years ago, everything ran fairly well. But …. a few windows and/or VS updates later it is completely broken. It is still a newish computer though, with plenty of compute, I think VS is the real issue.

Surely there is some windows guru here who can tell me what magical words to whisper to this computer to get it running fast again?

Or maybe VS is broken and I should use some other IDE? What do most people here do?

CLion perhaps? I have downloaded the installer but have yet to dig in.

Building with Ninja + Clang will probably be faster, but building with MSVC might still be required in some cases, so unfortunately that’s not really a complete solution.

I do have the same experience though, VS can hog a lot of resources. I also see this with Xcode on my Mac.

Messing with the build parallelism settings could help, that may not make a huge difference though.

1 Like

If you haven’t already, exclude VS and your repos from antivirus.

3 Likes

Funnily enough I have the exact opposite experience: incremental builds on Windows/MSVC take between 3 and 8 seconds depending on the plugin, and full rebuilds between 15 and 20 seconds. The same operations take ages and are a pain on MacOS/Xcode, on so many levels.

I attribute this to a few things that probably also apply to you:

  • my main machine is recent and powerful whereas the other is not because I just use it for building and testing from time to time
  • my main environment is reasonably well configured and optimized whereas I am completely clueless about the other one
  • I am used to any quirks on my main system whereas the other one feels weird and plain sucks :wink:

So yes, I am biased, and I can’t understand for the life of me how people manage with Xcode :smiley:

3 Likes

@fuo

Exactly my experience on Windows with VS2022 is faster than any other platform I’ve used.
Some random tips:

Don’t use a AV software, Windows Defender is all you’ll need.

Don’t install a load of crap on the computer, treat it as your work machine!

Download and run CCleaner - it’s free for basic needs.

Run the VS Installer and UNCHECK EVERYTHING apart from the C++ stuff. Including that ‘Copilot’ nonsense :grin:. I’ve seen people check every box they like the sound of, forgetting you can run the installer at any time after, and adjust what you want.

My computer that’s fairly old, but I can hit F5 and be debugging in FL studio in just a couple of seconds. I’m not exaggerating! Compile one file quickly, and a DAW is sitting there with my plug-in running, by the time I’ve reached for my cup of tea!

Xcode and MacOS on the other hand, makes me feel like I’m micro managing a fragile toy. :rofl::rofl:

1 Like

My plugins build in VS in less than a minute. And my entire DAW builds, from scratch, in two minutes and 13 seconds. If you haven’t rebuilt your development environment in a while, now might be the time to do it. I’d suggest that you wipe the slate clean, and reinstall everything fresh. I’ll wager that your builds will then go much faster.

For me as well, build times are quite comparable between VS2022 and XCode (and fast). The only time I see these crazy times and mouse freezes described initially is if a Windows machine runs out of RAM during building due to other applications using a lot of RAM.

Indeed your question lacks one key thing and that is the machines being used.

I use an M1 Pro machine and Intel Core Ultra 125H. The Windows machine got a weird throttling that I suspect related to battery/power supply where it goes around 0.4Ghz. But once solved. If it’s between 2.4-5Ghz it’s quite comparable to the M1 Pro.

Unrelatedly, upcoming VS claims to get things really really fast. I wonder how fast it’ll be.

Also, sticking with C++17 whenever possible makes compilation significantly faster.

1 Like

Now that would be great, got any link?
Beside copilot mentions everywhere the only info I could find was that it would bring “performance improvements that reset expectations for speed at enterprise scale” and that build time would now be “measured in moments” :roll_eyes:

One thing for sure: AI surely makes writing their blog posts faster…

So your task bar is full of software running all the time?

I haven’t used it for audio/JUCE/Visual Studio so not sure if it will help much but I have seen significant development boost (30-40%) in other projects by setting up a Dev Drive. I think mainly it helps with anti-virus/defender but it also uses a different file system which apparently is better suited for development.

2 Likes

Of course not. I just happen to notice (by accident) than the only way for me to get build-times of 10-12 min and a freezing mouse cursor like the thread starter sees is not having enough free RAM available. I thought sharing that info might help others as it’s a very easy thing to check.

1 Like

Thanks for explaining. Yeah, when Windows runs out of memory it starts using your drive as “virtual memory”, that paging operation would be very slow.

1 Like

Lots of great suggestions here! Thanks. I’ll try a few things mentioned and post here if anything clearly helps :slight_smile:

This might be a bit out of scope for what you are working with, but if you aren’t concerned about building and testing EVERY change you make, setting up CI/CD could help offload a lot of the time wasted building to some server elsewhere. Less stress for your PC, more time developing. A great thing about this as well, is that if you use git to its full extent, you can find the exact changes that break things by looking at your CI/CD build status’.

regardless, the other people here have generally summed up anything else i could have provided. Good luck :smiley:

1 Like

It should go without saying, but just in case you are using a desktop which still has HDDs then make sure you don’t use them for your dev environment - stick to SSD!

2 Likes

Ok - just a few follow ups.

This is a dedicated machine, nothing on it but VS2022 and Win 11.

I only use it for windows deployment. Antivirus is never running (only one installed is the windows defender one anyway).

I updated VS to the latest version, which did noticeably help.

It is, however, still painfully slow and occasionally just locks up the computer.

Watching the task manager I see that it runs low on ram (this computer has 4GB, which is the minimum for VS2022 apparently).

The real problem though - when it really locks up the message thread - seems to be when disk writing spikes to 100% and stays there for 30 seconds or so. Everything on the computer just freezes and waits.

It’s odd because when that happens the ram (memory column) is often only at ~60%, and CPU typically lower than that.

So, I’m not exactly sure whats going on there, though someone did point out that if it runs out of RAM it will try using virtual memory (ie, using the disk). Seems possible, except that the memory doest seem to be used up at that moment.

Anyway, gonna see about adding another RAM stick and see what happens.

It’s just frustrating because I bought this machine 4 years ago and thought it would last longer before the en-shit-ification took over.

4GB was already painful 10 years ago. I wouldn’t waste time doubling to 8GB and would get at least 16GB.

3 Likes

+1 4GB isn’t enough to run Windows 11 these days. For a dev machine, IMHO 32GB+ is the way to go, so my advice is getting the largest and fastest RAM sticks you can fit. If the 4GB is soldered, maybe it’s time for a different choice as asymmetric RAM configs are often slowing down RAM unnecessarily.
What machine brand/type is this? I have a hard time imagining any company was selling 4GB machines 4 years ago… unless it’s some kind of atom-based tablet.