Why is my new laptop’s VS Code so slow for C programming?

0
15
Asked By LoneWolf347 On

I've just set up VS Code on my brand new HP Victus, which has an i7 13th Gen processor, 24GB of RAM, and a 1TB SSD. I'm trying to use GCC/MinGW for my C programming. I wrote a simple program that reverses a word using arrays—nothing complicated at all. However, when I run it, VS Code either takes over 400 seconds to execute, freezes, or crashes with exit code=1.

I've already tried a bunch of things to fix this:
1. Uninstalled Code Runner
2. Moved all project files out of OneDrive
3. Ran VS Code as an administrator
4. Tried both CMD and PowerShell
5. Compiled directly from the terminal instead of using the Run button
6. Cleaned up my tasks.json file
7. Double-checked my actual code

Despite everything, the issue persists. Since my laptop's hardware should handle this easily, I'm really at a loss. Has anyone experienced a similar issue or know how to fix it? I'd love to get back to coding without the wait.

5 Answers

Answered By CodeWizard99 On

Have you checked where your compiler is installed? If it’s somehow inside OneDrive, moving it out could help. Sometimes, syncing services cause strange delays.

LoneWolf347 -

I’ve already moved everything out of OneDrive, so that shouldn’t be the issue.

Answered By TechieTina23 On

When you compile and run your code directly from the terminal, does it execute quickly? If it runs fast there, it might be an issue specific to how VS Code is set up. If you find that it’s slow only when using the Run button in VS Code, that’s definitely something to look into.

LoneWolf347 -

Yeah, it runs instantly from the terminal! The lag only happens when I use the Run button in VS Code.

Answered By WinDevPro On

You might consider switching to WSL2. I've found that GCC on Windows can be a real hassle. Using WSL2 or even MSVC with Visual Studio Community Edition might offer a smoother experience than mixing Windows, VS Code, and GCC, which can be a real headache.

Answered By DevGuru2021 On

Curious if you’re using the standard version of VS Code or the Insiders edition? I find that the normal blue VS Code tends to work better for most setups. Just a thought!

LoneWolf347 -

I’m using the normal one, not Insiders.

Answered By SecuritySavvy On

Antivirus software can really slow down the performance by scanning every file each time they're accessed, especially for smaller files like C/C++ headers. It’s worth checking if you have any antivirus running that might be impacting this. Disabling it might speed things up, even if it doesn't explain your terminal speed.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.