aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-01-08 22:30:14 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-01-08 22:30:14 +0100
commit76b84365234ce53cd6b2509947beed9ad2c28d4e (patch)
treed920876275f2d7d4861c2e9b658ee113716c77d5 /container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
parent4cd39189f1dcf1659fe689a1e6c12a504b63f4d0 (diff)
Cache CompoundName and Binding instances created during compilation
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
index be4a683d9d2..1978740014c 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/QueryProfile.java
@@ -18,7 +18,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -266,10 +265,13 @@ public class QueryProfile extends FreezableSimpleComponent implements Cloneable
}
AllValuesQueryProfileVisitor visitValues(CompoundName prefix, Map<String, String> context) {
- DimensionBinding dimensionBinding = DimensionBinding.createFrom(getDimensions(), context);
+ return visitValues(prefix, context, new HashMap<>());
+ }
- AllValuesQueryProfileVisitor visitor = new AllValuesQueryProfileVisitor(prefix);
- accept(visitor, dimensionBinding, null);
+ AllValuesQueryProfileVisitor visitValues(CompoundName prefix, Map<String, String> context,
+ Map<CompoundName, Map<String, CompoundName>> pathCache) {
+ AllValuesQueryProfileVisitor visitor = new AllValuesQueryProfileVisitor(prefix, pathCache);
+ accept(visitor, DimensionBinding.createFrom(getDimensions(), context), null);
return visitor;
}