1

When Rebuilding a website (single project) in Visual Studio 2019, with hundreds of .cs files, Visual Studio seems to use only 5% of the available CPU.

Any ideas of what might be causing this?

Karlth
  • 3,267
  • 2
  • 27
  • 28
  • 1
    The limiting factor might not be the CPU, but disk I/O. – PMF Apr 20 '22 at 14:33
  • 1
    Disk I/O is barely above 2% in the Task manager. – Karlth Apr 20 '22 at 14:40
  • How long does it take to compile? – DavidG Apr 20 '22 at 14:47
  • Rebuild takes around 3 minutes on a Ryzer 5600 CPU. 800 .cs files. – Karlth Apr 20 '22 at 14:52
  • 1
    800 files in a single project? Yikes. Have you considered splitting them into distinct projects? That way you don't need to recompile them all every time you make a change. – DavidG Apr 20 '22 at 14:54
  • It is a website, mostly codebehind .cs files, so rebuilds are not common. Nevertheless it is still annoying when it happens and I find it the low CPU load curious. – Karlth Apr 20 '22 at 14:58
  • 2
    AFAIK Visual Studio will only use multiple CPUs/cores/threads for multiple projects. Building a single project cannot be parallelized by VS. But be aware that projects can only be built in parallel if they don't depend on each other. – Good Night Nerd Pride Apr 20 '22 at 15:03
  • [/MP (Build with Multiple Processes)](https://learn.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes) – stuartd Apr 20 '22 at 16:12
  • 1
    Does [this](https://stackoverflow.com/questions/12095718/visual-studio-build-very-slow) can help you? – Jingmiao Xu-MSFT Apr 21 '22 at 02:51

0 Answers0