Use core affinity on windows to improve performance

This commit is contained in:
hailIulius
2016-04-27 19:35:32 +02:00
committed by Laurent Clouet
parent 32540e7712
commit be3a30facc
4 changed files with 30 additions and 0 deletions

View File

@@ -133,6 +133,10 @@ public class Windows extends OS {
Process p = builder.start();
WinProcess wproc = new WinProcess(p);
wproc.setPriority(WinProcess.PRIORITY_BELOW_NORMAL);
if (env != null) {
String cores = env.get("CORES");
wproc.setAffinity(Integer.parseInt(cores));
}
return p;
}