aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2015-06-09 12:35:06 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-06-10 16:02:07 +0000
commit6c5688d121cba9e68259be13a0ce39dc4f026f9a (patch)
treea2390eafe8a41160d7df545498f0284f7a57e3c1 /src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java
parentfa759e2fe6698cabfe250a77bdd446f7eaca8a5f (diff)
Implement persistent worker processes and a spawn strategy that uses them.
This will be used by the persistent JavaBuilder, which improves performance of Java compilation by 4x due to profiting from JVM JIT optimizations and not having to relaunch the JVM for every spawn. It is completely generic though, so as long as a tool (ProGuard? Dexer? Whatever.) conforms to the Worker process protocol, it can use the new spawn strategy. -- MOS_MIGRATED_REVID=95527132
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java b/src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java
new file mode 100644
index 0000000000..5dd7db01b9
--- /dev/null
+++ b/src/main/java/com/google/devtools/build/lib/worker/WorkerOptions.java
@@ -0,0 +1,39 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package com.google.devtools.build.lib.worker;
+
+import com.google.devtools.common.options.Option;
+import com.google.devtools.common.options.Options;
+import com.google.devtools.common.options.OptionsBase;
+
+/**
+ * Options related to worker processes.
+ */
+public class WorkerOptions extends OptionsBase {
+ public static final WorkerOptions DEFAULTS = Options.getDefaults(WorkerOptions.class);
+
+ @Option(name = "worker_max_instances",
+ defaultValue = "4",
+ category = "strategy",
+ help = "How many instances of a worker process (like the persistent Java compiler) may be "
+ + "launched if you use the 'worker' strategy.")
+ public int workerMaxInstances;
+
+ @Option(name = "experimental_persistent_javac",
+ defaultValue = "null",
+ category = "undocumented",
+ help = "Enable the experimental persistent Java compiler.",
+ expansion = {"--strategy=Javac=worker", "--strategy=JavaIjar=local"})
+ public Void experimentalPersistentJavac;
+}