aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/query
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2020-07-17 11:45:27 +0200
committerJon Bratseth <bratseth@gmail.com>2020-07-17 11:45:27 +0200
commit667eedc92b4c9c81c3872e000a8f26779b9bf131 (patch)
treed1ff7e4115c70877104c1f0e803417e50399f925 /container-search/src/test/java/com/yahoo/search/query
parent8dad7e25c8d1bd022880327a0c7f57e48efc302f (diff)
Faster lookup given many variants
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/query')
-rw-r--r--container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java
index e85940278e3..bd14efb4dfa 100644
--- a/container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/query/profile/config/test/XmlReadingTestCase.java
@@ -32,6 +32,37 @@ import static org.junit.Assert.fail;
public class XmlReadingTestCase {
@Test
+ @Ignore
+ public void testTmp() {
+ QueryProfileRegistry registry =
+ new QueryProfileXMLReader().read("/Users/bratseth/development/slingstone/massmedia_serving/homerun/src/main/application/search/flattened");
+ long startTime = System.currentTimeMillis();
+ System.out.println("Compiling ...");
+ CompiledQueryProfileRegistry cRegistry = registry.compile();
+ System.out.println("Done in " + (( System.currentTimeMillis() - startTime) / 1000) + " seconds");
+ System.out.println("");
+ CompiledQueryProfile cProfile = cRegistry.getComponent("megastream_unified");
+
+ Query q = new Query("?debug=true&clientId=default&langReg=en-US&format=xml&tracelevel=4&" +
+ "trace.timestamps=true&site=frontpage&streamBucketId=ga&configId=default&" +
+ "queryProfile=megastream_unified&lang=ENGLISH&region=US&", cProfile);
+ q.properties().listProperties();
+
+ // About 60 ms with tracelevel=4, a few ms with tracelevel=0
+ startTime = System.currentTimeMillis();
+ System.out.println("Creating query ...");
+ new Query("?debug=true&clientId=default&langReg=en-US&format=xml&tracelevel=0&" +
+ "trace.timestamps=true&site=frontpage&streamBucketId=ga&configId=default&" +
+ "queryProfile=megastream_unified&lang=ENGLISH&region=US&", cProfile);
+ System.out.println("Done in " + (System.currentTimeMillis() - startTime) + " ms");
+
+ startTime = System.currentTimeMillis();
+ System.out.println("listProperties() ...");
+ q.properties().listProperties().forEach((k, v) -> System.out.println(" " + k + "=" + v));
+ System.out.println("Done in " + (System.currentTimeMillis() - startTime) + " ms");
+ }
+
+ @Test
public void testInheritance() {
QueryProfileRegistry registry =
new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/inheritance");