C++ How to limit visual studios multi-processor compilation

后端 未结 7 555
不思量自难忘°
不思量自难忘° 2021-02-02 10:24

Every time I compile using visual studio the rest of my computer crawls because visual studio is hogging all the processors. Is there a way to limit the number of processors tha

7条回答
  •  余生分开走
    2021-02-02 11:17

    A more optimal answer comes from Mikhail Virovets at https://developercommunity.visualstudio.com/comments/497084/view.html

    Decrease the compiler process priority to below normal. This means it will use as much CPU as possible but without interfering with other things you're trying to use.

    Define a registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cl.exe\PerfOptions
    

    Then create a DWORD value named CpuPriorityClass = 5 (5 means "below normal").

    Note that this affects all processes named "cl.exe".

提交回复
热议问题