Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CompilePalX/Compilers/CompileExecutable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public override void Run(CompileContext c)
Process.Start();
Process.PriorityClass = ProcessPriorityClass.BelowNormal;

//VRAD can only use up to 16 cores, more cores reduces performance, and increased compile time.
//By assigning affinity to the process significantly speed up compiles on CPUs with more than 16 cores.
if (this.Name == "VRAD" &&
Environment.ProcessorCount > 16)
{
//Hex 0xffff means core use core 0 through 15.
Process.ProcessorAffinity = (IntPtr)0xffff;
}

if (Metadata.ReadOutput)
readOutput();
}
Expand Down