aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-04-01 19:12:26 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-01 19:14:01 -0700
commit52859b454b4426e98d3106c95e5b16e56b5cd437 (patch)
treee7e44cb27fa06fb553ed904a2bb14ea60f86e4a8 /src/main/java/com/google/devtools/build/lib/rules
parentf54d7e5293cc40ce3507a9adef530e46ab817585 (diff)
Change profiling to only accept strings for its "description" argument. Profiling can hold onto objects for the duration of the build, and some of those objects may be temporary that should not be persisted. In particular, UnixGlob and its inner classes should not outlive loading and analysis. For the most part, care was taken in this CL to only use strings that required no additional construction, mainly to minimize garbage (retaining references to newly created strings is not as great a concern since only the strings corresponding to the slowest K tasks are retained, for some relatively small values of K). Action descriptions for actually executing actions are eagerly expanded because that work is minimal compared to the work of actually executing an action.
PiperOrigin-RevId: 191251488
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
index 1e7b65b4b6..913088648f 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
@@ -1003,17 +1003,12 @@ public class CppCompileAction extends AbstractAction
}
}
- /**
- * Recalculates this action's live input collection, including sources, middlemen.
- *
- * @throws ActionExecutionException iff any errors happen during update.
- */
- @VisibleForTesting // productionVisibility = Visibility.PRIVATE
+ /** Recalculates this action's live input collection, including sources, middlemen. */
+ @VisibleForTesting // productionVisibility = Visibility.PRIVATE
@ThreadCompatible
- public final void updateActionInputs(NestedSet<Artifact> discoveredInputs)
- throws ActionExecutionException {
+ public final void updateActionInputs(NestedSet<Artifact> discoveredInputs) {
NestedSetBuilder<Artifact> inputs = NestedSetBuilder.stableOrder();
- Profiler.instance().startTask(ProfilerTask.ACTION_UPDATE, this);
+ Profiler.instance().startTask(ProfilerTask.ACTION_UPDATE, describe());
try {
inputs.addTransitive(mandatoryInputs);
if (optionalSourceFile != null) {