[
https://issues.apache.org/jira/browse/TINKERPOP-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15353712#comment-15353712
]
pieter martin commented on TINKERPOP-1349:
------------------------------------------
I ran this,
{code}
@Test
public void testRepeat() throws IOException {
Graph graph = TinkerGraph.open();
GraphTraversalSource g = graph.traversal();
graph.io(GraphMLIo.build()).readGraph("../data/grateful-dead.xml");
long timeStart = System.currentTimeMillis();
GraphTraversal<Vertex, Vertex> traversal =
graph.traversal().V().out().out().out();
Vertex v = null;
while (traversal.hasNext()) {
v = traversal.next();
}
System.out.println("done");
long timeEnd = System.currentTimeMillis();
System.out.println(timeEnd - timeStart);
timeStart = System.currentTimeMillis();
traversal = graph.traversal().V().out().out().out();
v = null;
while (traversal.hasNext()) {
v = traversal.next();
}
System.out.println("done");
timeEnd = System.currentTimeMillis();
System.out.println(timeEnd - timeStart);
timeStart = System.currentTimeMillis();
traversal = graph.traversal().V().out().out().out();
while (traversal.hasNext()) {
v = traversal.next();
}
System.out.println("done");
timeEnd = System.currentTimeMillis();
System.out.println(timeEnd - timeStart);
}
{code}
output
{code}
done
880
done
633
done
555
{code}
> RepeatUnrollStrategy should unroll loops while maintaining equivalent
> semantics.
> --------------------------------------------------------------------------------
>
> Key: TINKERPOP-1349
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1349
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.2.0-incubating
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
> Fix For: 3.2.0-incubating
>
>
> Create {{RepeatUnrollStrategy}} that will unroll patterns such as:
> {code}
> repeat(out()).times(3)
> // ->
> out().barrier().out().barrier().out().barrier()
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)