diff options
author | Philipp Wollermann <philwo@google.com> | 2016-06-21 14:18:40 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-06-21 14:47:56 +0000 |
commit | c20091450f48b34c909716452767312cfb8f2fc4 (patch) | |
tree | 30870ddac16afadac22ec2c1eb80570ebd692043 /scripts/bootstrap/compile.sh | |
parent | 24ec1bfa0b9ed78ce5ce7b7e90612f24a60d2a54 (diff) |
When running Java-based tools, use -XX:+TieredCompilation -XX:TieredStopAtLevel=1 instead of -client, as the latter is ignored on 64-bit JVMs since at least JDK 6.
The new flags have been shown to cut down CPU time by 50% due to reduced time spent in JIT and improving overall run time for short running actions, some times also cutting them in half.
Here's a benchmark of Bazel building itself, giving a nice 2-4x speedup:
./output/bazel clean && ./output/bazel build //src:bazel
Bazel before this change:
INFO: Elapsed time: 197.783s, Critical Path: 194.10s
INFO: Elapsed time: 198.928s, Critical Path: 195.65s
INFO: Elapsed time: 194.913s, Critical Path: 191.56s
Bazel before this change with --strategy=Javac=worker:
INFO: Elapsed time: 130.436s, Critical Path: 124.27s
INFO: Elapsed time: 116.114s, Critical Path: 112.30s
INFO: Elapsed time: 116.852s, Critical Path: 84.45s
Bazel with this change:
INFO: Elapsed time: 121.625s, Critical Path: 119.08s
INFO: Elapsed time: 119.401s, Critical Path: 115.80s
INFO: Elapsed time: 121.198s, Critical Path: 119.03s
Bazel with this change and --strategy=Javac=worker:
INFO: Elapsed time: 54.456s, Critical Path: 51.28s
INFO: Elapsed time: 53.272s, Critical Path: 51.09s
INFO: Elapsed time: 52.966s, Critical Path: 49.86s
Bazel with this change and --strategy=Javac=worker and stripping -XX:TieredStopAtLevel=1 from JVM flags when using workers:
INFO: Elapsed time: 61.599s, Critical Path: 58.93s
INFO: Elapsed time: 48.695s, Critical Path: 45.02s
INFO: Elapsed time: 46.874s, Critical Path: 43.91s
INFO: Elapsed time: 46.174s, Critical Path: 43.32s
(The latter is a possible optimization for workers and it's also nice to know that the limited tiered compilation does not hurt their performance.)
--
MOS_MIGRATED_REVID=125448089
Diffstat (limited to 'scripts/bootstrap/compile.sh')
-rwxr-xr-x | scripts/bootstrap/compile.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index f0a797ed36..63a5777e76 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -266,8 +266,10 @@ cp src/tools/xcode/xcodelocator/xcode_locator_stub.sh ${ARCHIVE_DIR}/_embedded_b # bazel build using bootstrap version function bootstrap_build() { "${JAVA_HOME}/bin/java" \ - -client -Xms256m -XX:NewRatio=4 -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=ISO-8859-1 \ - -XX:HeapDumpPath=${OUTPUT_DIR} \ + -XX:+TieredCompilation -XX:TieredStopAtLevel=1 \ + -Xms256m -XX:NewRatio=4 -Xverify:none \ + -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${OUTPUT_DIR} \ + -Dfile.encoding=ISO-8859-1 \ -Djava.util.logging.config.file=${OUTPUT_DIR}/javalog.properties \ -Dio.bazel.UnixFileSystem=0 \ -jar ${ARCHIVE_DIR}/libblaze.jar \ |