diff options
author | 2016-06-21 14:18:40 +0000 | |
---|---|---|
committer | 2016-06-21 14:47:56 +0000 | |
commit | c20091450f48b34c909716452767312cfb8f2fc4 (patch) | |
tree | 30870ddac16afadac22ec2c1eb80570ebd692043 /tools | |
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 'tools')
-rw-r--r-- | tools/jdk/BUILD | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/jdk/BUILD b/tools/jdk/BUILD index 96581b0660..a62f06721c 100644 --- a/tools/jdk/BUILD +++ b/tools/jdk/BUILD @@ -124,7 +124,10 @@ java_toolchain( ijar = ["@bazel_tools//tools/jdk:ijar"], javabuilder = ["//tools/jdk:JavaBuilder_deploy.jar"], javac = ["//third_party/java/jdk/langtools:javac_jar"], - jvm_opts = ["-client"], + jvm_opts = [ + "-XX:+TieredCompilation", + "-XX:TieredStopAtLevel=1", + ], singlejar = ["//tools/jdk:SingleJar_deploy.jar"], source_version = "8", target_version = "8", |