diff options
author | Janak Ramakrishnan <janakr@google.com> | 2016-11-16 23:16:53 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-11-17 18:18:20 +0000 |
commit | 3207f936c7f56749b5f6635b5fc7a2a99af9c963 (patch) | |
tree | c401b4349d97989e17f34b41c714ae97eb5ec6af /src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java | |
parent | f16f7c59ecfeaf6bd7e667945cfdc5e44637c5bf (diff) |
Cache all previously computed values in SkyQueryEnvironment#beforeEvaluateQuery if possible to save on latency for small queries.
This assumes that if the graph is up to date, then the data in SkyQueryEnvironment is also up to date. It also assumes that a ForkJoinPool remains usable until #shutdownNow is called.
--
MOS_MIGRATED_REVID=139386363
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java index d572058eac..8901745c00 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrecomputedValue.java @@ -58,7 +58,7 @@ public final class PrecomputedValue implements SkyValue { } void inject(Injectable injectable) { - injectable.inject(ImmutableMap.of(precomputed.key, new PrecomputedValue(supplier.get()))); + injectable.inject(precomputed.key, new PrecomputedValue(supplier.get())); } } @@ -179,7 +179,7 @@ public final class PrecomputedValue implements SkyValue { * Injects a new variable value. */ public void set(Injectable injectable, T value) { - injectable.inject(ImmutableMap.of(key, new PrecomputedValue(value))); + injectable.inject(key, new PrecomputedValue(value)); } } } |