tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject tinkerpop git commit: a bunch of minor optimizations to the Traverser species (direct refernece calls instead of method calls) and made MatchStep a bit more efficient too for local barrier.
Date Tue, 12 Jul 2016 23:20:17 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/master 9242421e5 -> cc5906246


a bunch of minor optimizations to the Traverser species (direct refernece calls instead of
method calls) and made MatchStep a bit more efficient too for local barrier.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cc590624
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cc590624
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cc590624

Branch: refs/heads/master
Commit: cc5906246e58b8bd3d5dc114a6d77c2fd950adce
Parents: 9242421
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Jul 12 17:20:11 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Jul 12 17:20:11 2016 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/map/MatchStep.java     | 10 ++++------
 .../traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java   |  8 ++++----
 .../traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java  |  8 ++++----
 .../traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java    |  8 ++++----
 .../traversal/traverser/O_OB_S_SE_SL_Traverser.java       |  6 +++---
 .../tinkergraph/structure/TinkerGraphPlayTest.java        |  2 +-
 6 files changed, 20 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index d829020..8909d68 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -364,19 +364,17 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S,
Map<String, E>>
                         this.keepLabels.containsAll(this.matchEndLabels) &&
                         this.keepLabels.containsAll(this.matchStartLabels))
                     this.keepLabels = null;
-            } else { // TODO: if(standardAlgorithmBarrier.isEmpty()) -- leads to consistent
counts without retracting paths, but orders of magnitude slower.
+            } else { // TODO: if(standardAlgorithmBarrier.isEmpty()) -- leads to consistent
counts without retracting paths, but orders of magnitude slower (or make Traverser.tags an
equality concept)
                 boolean stop = false;
                 for (final Traversal.Admin<?, ?> matchTraversal : this.matchTraversals)
{
-                    while (matchTraversal.hasNext() &&
-                            this.standardAlgorithmBarrier.size() < PathRetractionStrategy.DEFAULT_STANDARD_BARRIER_SIZE)
{ // TODO: perhaps make MatchStep a LocalBarrierStep ??
+                    while (matchTraversal.hasNext()) { // TODO: perhaps make MatchStep a
LocalBarrierStep ??
                         this.standardAlgorithmBarrier.add(matchTraversal.getEndStep().next());
-                        if (null == this.keepLabels) {
+                        if (null == this.keepLabels || this.standardAlgorithmBarrier.size()
>= PathRetractionStrategy.DEFAULT_STANDARD_BARRIER_SIZE) {
                             stop = true;
                             break;
                         }
                     }
-                    if (stop)
-                        break;
+                    if (stop) break;
                 }
             }
             final Traverser.Admin traverser;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
index 30641bb..7064cd0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
@@ -87,11 +87,11 @@ public class B_LP_O_P_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T>
{
     @Override
     public boolean equals(final Object object) {
         return (object instanceof B_LP_O_P_S_SE_SL_Traverser)
-                && ((B_LP_O_P_S_SE_SL_Traverser) object).get().equals(this.t)
-                && ((B_LP_O_P_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
-                && ((B_LP_O_P_S_SE_SL_Traverser) object).loops() == this.loops()
+                && ((B_LP_O_P_S_SE_SL_Traverser) object).t.equals(this.t)
+                && ((B_LP_O_P_S_SE_SL_Traverser) object).future.equals(this.future)
+                && ((B_LP_O_P_S_SE_SL_Traverser) object).loops == this.loops
                 && (null == this.sack || null != this.sideEffects.getSackMerger())
-                && ((B_LP_O_P_S_SE_SL_Traverser) object).path().equals(this.path);
+                && ((B_LP_O_P_S_SE_SL_Traverser) object).path.equals(this.path);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java
index 97b79a4..5f24e8c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_P_S_SE_SL_Traverser.java
@@ -112,11 +112,11 @@ public class LP_O_OB_P_S_SE_SL_Traverser<T> extends O_OB_S_SE_SL_Traverser<T>
{
     @Override
     public boolean equals(final Object object) {
         return (object instanceof LP_O_OB_P_S_SE_SL_Traverser)
-                && ((LP_O_OB_P_S_SE_SL_Traverser) object).get().equals(this.t)
-                && ((LP_O_OB_P_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
-                && ((LP_O_OB_P_S_SE_SL_Traverser) object).loops() == this.loops()
+                && ((LP_O_OB_P_S_SE_SL_Traverser) object).t.equals(this.t)
+                && ((LP_O_OB_P_S_SE_SL_Traverser) object).future.equals(this.future)
+                && ((LP_O_OB_P_S_SE_SL_Traverser) object).loops == this.loops
                 && (null == this.sack || null != this.sideEffects.getSackMerger())
-                && ((LP_O_OB_P_S_SE_SL_Traverser) object).path().equals(this.path);
+                && ((LP_O_OB_P_S_SE_SL_Traverser) object).path.equals(this.path);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java
index 8ec5de5..c9cc67c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/LP_O_OB_S_SE_SL_Traverser.java
@@ -93,10 +93,10 @@ public class LP_O_OB_S_SE_SL_Traverser<T> extends O_OB_S_SE_SL_Traverser<T>
{
     @Override
     public boolean equals(final Object object) {
         return (object instanceof LP_O_OB_S_SE_SL_Traverser)
-                && ((LP_O_OB_S_SE_SL_Traverser) object).get().equals(this.t)
-                && ((LP_O_OB_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
-                && ((LP_O_OB_S_SE_SL_Traverser) object).loops() == this.loops()
+                && ((LP_O_OB_S_SE_SL_Traverser) object).t.equals(this.t)
+                && ((LP_O_OB_S_SE_SL_Traverser) object).future.equals(this.future)
+                && ((LP_O_OB_S_SE_SL_Traverser) object).loops == this.loops
                 && (null == this.sack || null != this.sideEffects.getSackMerger())
-                && ((LP_O_OB_S_SE_SL_Traverser) object).path().popEquals(Pop.last,
this.path); // this should be Pop.all?
+                && ((LP_O_OB_S_SE_SL_Traverser) object).path.popEquals(Pop.last,
this.path); // this should be Pop.all?
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/O_OB_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/O_OB_S_SE_SL_Traverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/O_OB_S_SE_SL_Traverser.java
index 1ed5ad9..44a7cbb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/O_OB_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/O_OB_S_SE_SL_Traverser.java
@@ -130,9 +130,9 @@ public class O_OB_S_SE_SL_Traverser<T> extends O_Traverser<T>
{
     @Override
     public boolean equals(final Object object) {
         return object instanceof O_OB_S_SE_SL_Traverser
-                && ((O_OB_S_SE_SL_Traverser) object).get().equals(this.t)
-                && ((O_OB_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
-                && ((O_OB_S_SE_SL_Traverser) object).loops() == this.loops()
+                && ((O_OB_S_SE_SL_Traverser) object).t.equals(this.t)
+                && ((O_OB_S_SE_SL_Traverser) object).future.equals(this.future)
+                && ((O_OB_S_SE_SL_Traverser) object).loops == this.loops
                 && (null == this.sack || (null != this.sideEffects && null
!= this.sideEffects.getSackMerger())); // hmmm... serialization in OLAP destroys the transient
sideEffects
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cc590624/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
index 33a3d94..3654ffd 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
@@ -80,7 +80,7 @@ public class TinkerGraphPlayTest {
             System.out.println(source.V().has("performances", P.gt(500)).match(
                     __.as("a").out().as("b"),
                     __.as("b").out().as("c"),
-                    __.as("c").out().as("a")).select("a","b","c").profile().next());
+                    __.as("c").out().as("a")).select("a").profile().next());
         }
     }
 


Mime
View raw message