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 /src/java_tools/buildjar | |
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 'src/java_tools/buildjar')
-rw-r--r-- | src/java_tools/buildjar/BUILD | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/java_tools/buildjar/BUILD b/src/java_tools/buildjar/BUILD index 56298dfd1a..dc16a42940 100644 --- a/src/java_tools/buildjar/BUILD +++ b/src/java_tools/buildjar/BUILD @@ -54,7 +54,10 @@ java_toolchain( ijar = ["//third_party/ijar"], javabuilder = ["bootstrap_deploy.jar"], javac = ["//third_party/java/jdk/langtools:javac_jar"], - jvm_opts = ["-client"], + jvm_opts = [ + "-XX:+TieredCompilation", + "-XX:TieredStopAtLevel=1", + ], singlejar = ["//src/java_tools/singlejar:bootstrap_deploy.jar"], source_version = "8", target_version = "8", @@ -70,7 +73,10 @@ java_toolchain( ijar = ["//third_party/ijar"], javabuilder = ["//third_party/java/jdk/javabuilder:JavaBuilder_0.1.0"], javac = ["//third_party/java/jdk/langtools:javac7_jar"], - jvm_opts = ["-client"], + jvm_opts = [ + "-XX:+TieredCompilation", + "-XX:TieredStopAtLevel=1", + ], singlejar = ["//src/java_tools/singlejar:bootstrap_deploy.jar"], source_version = "7", target_version = "7", |