aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@google.com>2017-12-11 12:19:34 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-11 12:21:13 -0800
commit5a3c7ab1ea9adcdf93b2cb5018a48cc5538c7368 (patch)
tree7190d52648c0571521847e00312b7ba23a3e7494 /src/main/java/com/google
parent35ce88dccb4bbdeb6a6bcc1c01d9842565d7123c (diff)
Remove hyperthreading multiplier to improve performance.
Tests on my local machine show that the Hyperthreading multiplier is significantly hurting our builds times. Running with 8 logical cores is 11% faster than running with 4.8 cores when doing builds on my Mac. macOS 10.12 MacBookPro 2017 (1 CPU, 4 core, 8 hyperthreaded) 1434.259 with --jobs = 5 1274.459 with --jobs = 8 I'll do some similar tests on Linux to see if it makes sense there. PiperOrigin-RevId: 178654477
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerDarwin.java9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerDarwin.java b/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerDarwin.java
index 3cde7f2e64..abaa7f904e 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerDarwin.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerDarwin.java
@@ -24,16 +24,11 @@ import java.io.IOException;
public class LocalHostResourceManagerDarwin {
private static final Boolean JNI_UNAVAILABLE =
"0".equals(System.getProperty("io.bazel.EnableJni"));
- private static final double EFFECTIVE_CPUS_PER_HYPERTHREADED_CPU = 0.6;
private static int getLogicalCpuCount() throws IOException {
return (int) NativePosixSystem.sysctlbynameGetLong("hw.logicalcpu");
}
- private static int getPhysicalCpuCount() throws IOException {
- return (int) NativePosixSystem.sysctlbynameGetLong("hw.physicalcpu");
- }
-
private static double getMemoryInMb() throws IOException {
return NativePosixSystem.sysctlbynameGetLong("hw.memsize") / 1E6;
}
@@ -44,13 +39,11 @@ public class LocalHostResourceManagerDarwin {
}
try {
int logicalCpuCount = getLogicalCpuCount();
- int physicalCpuCount = getPhysicalCpuCount();
double ramMb = getMemoryInMb();
- boolean hyperthreading = (logicalCpuCount != physicalCpuCount);
return ResourceSet.create(
ramMb,
- logicalCpuCount * (hyperthreading ? EFFECTIVE_CPUS_PER_HYPERTHREADED_CPU : 1.0),
+ logicalCpuCount,
1.0,
Integer.MAX_VALUE);
} catch (IOException e) {