aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/cpp
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2016-06-21 14:18:40 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-06-21 14:47:56 +0000
commitc20091450f48b34c909716452767312cfb8f2fc4 (patch)
tree30870ddac16afadac22ec2c1eb80570ebd692043 /src/main/cpp
parent24ec1bfa0b9ed78ce5ce7b7e90612f24a60d2a54 (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/main/cpp')
-rw-r--r--src/main/cpp/blaze.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index c706c37ae0..b726ecf8a4 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -413,7 +413,8 @@ static vector<string> GetArgumentArray() {
blaze_util::Dirname(blaze_util::Dirname(globals->jvm_path)),
&result);
if (globals->options.batch) {
- result.push_back("-client");
+ result.push_back("-XX:+TieredCompilation");
+ result.push_back("-XX:TieredStopAtLevel=1");
result.push_back("-Xms256m");
result.push_back("-XX:NewRatio=4");
} else {