-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vcpkg spawns processes with IDLE_PRIORITY_CLASS
, causing slow builds with low CPU usage on Windows
#42715
Comments
Can you give a specific example? |
Yes, |
Hmm are you on a system with more than 64 cores? |
No. The number of processes is correct (I have 24 cores and there are roughly 24 cl.exe processes in task manager). It's just the number of utilized CPUs that is clearly incorrect; these 24 processes seem to only make 8 cores go 100% on task manager, and other cores are barely working. And once I manually set the ninja.exe's priority to Normal in Task Manager. All cores were working. I tested this on my work PC today which has 32 logical cores. The problem manfested as it did on my home PC. |
Exactly. |
Describe the bug
Build related processes like Ninja spawned by vcpkg seem to have a very low priority, causing the build to use very few CPU cores despite setting the VCPKG_MAX_CONCURRENCY to a high value.
Environment
To Reproduce
Steps to reproduce the behavior:
Expected behavior
At least give it a normal priority!
Additional context
The issue is caused by this in
windows_create_process
which vcpkg uses to spawn subprocesses on Windows. For some reason, the priority is set to IDLE_PRIORITY_CLASS, which according to the doc, 'run only when the system is idle'. This is probably affecting the performance of vcpkg for years as it was introduced in the very beginning of the commit history.By setting the value to NORMAL_PRIORITY_CLASS, I was able to fix this issue. Please change this or make this configurable. I would be happy to make a pr if this is indeed a bug.
The text was updated successfully, but these errors were encountered: