Skip to content

Vcpkg spawns processes with IDLE_PRIORITY_CLASS, causing slow builds with low CPU usage on Windows #42715

Open
microsoft/vcpkg-tool
#1555
@Binary-Song

Description

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

  • OS: Windows
  • Compiler: revision

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install xxx
  2. Bring up Task Manager
  3. Right click on Ninja.exe, go to details
  4. Right click and look at the priority
  5. It is Low

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.

Metadata

Assignees

Labels

category:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions