tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [2/7] incubator-tinkerpop git commit: Don't profile computer steps.
Date Mon, 21 Mar 2016 18:36:15 GMT
Don't profile computer steps.


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

Branch: refs/heads/TINKERPOP-1199
Commit: 3f25710b10301432ea64996330a084872d8bc78f
Parents: e73bbc5
Author: rjbriody <bob.briody@datastax.com>
Authored: Thu Mar 17 17:38:26 2016 -0400
Committer: rjbriody <bob.briody@datastax.com>
Committed: Thu Mar 17 17:38:26 2016 -0400

----------------------------------------------------------------------
 .../strategy/finalization/ProfileStrategy.java         | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3f25710b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
index dd66e1c..5eb16eb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
@@ -18,6 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization;
 
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ComputerResultStep;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.TraversalVertexProgramStep;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -50,9 +52,14 @@ public final class ProfileStrategy extends AbstractTraversalStrategy<TraversalSt
         // Add .profile() step after every pre-existing step.
         final List<Step> steps = traversal.getSteps();
         final int numSteps = steps.size();
-        for (int ii = 0; ii < numSteps; ii++) {
+        for (int ii = 0; ii < numSteps; ii += 2) {
             // Get the original step
-            Step step = steps.get(ii * 2);
+            Step step = steps.get(ii);
+            if (step instanceof TraversalVertexProgramStep || step instanceof ComputerResultStep)
{
+                ii--;
+                // don't profile the computer steps
+                continue;
+            }
 
             // Do not inject profiling after ProfileSideEffectStep as this will be the last
step on the root traversal.
             if (step instanceof ProfileSideEffectStep) {
@@ -61,7 +68,7 @@ public final class ProfileStrategy extends AbstractTraversalStrategy<TraversalSt
 
             // Create and inject ProfileStep
             ProfileStep profileStep = new ProfileStep(traversal);
-            traversal.addStep((ii * 2) + 1, profileStep);
+            traversal.addStep(ii + 1, profileStep);
         }
     }
 


Mime
View raw message