andreachild commented on code in PR #3241:
URL: https://github.com/apache/tinkerpop/pull/3241#discussion_r2446811368
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java:
##########
@@ -39,7 +45,10 @@ public final class RangeGlobalStep<S> extends FilterStep<S>
implements RangeGlob
private long low;
private long high;
- private AtomicLong counter = new AtomicLong(0l);
+ /**
+ * If this range step is used inside a loop there can be multiple
counters, otherwise there should only be one
+ */
+ private Map<String, AtomicLong> counters = new HashMap<>();
Review Comment:
I'm not sure if performance comparison of range in repeat for 3.7 vs 3.8 is
useful due to the semantics change - it is expected that 3.8 would be 'slower'
because traversers that were previously filtered in 3.7 would now be passed to
subsequent iterations and steps for processing.
I would like to get this PR merged before our 3.8 gameday tomorrow but I can
follow up with some `GraphTraversalBenchmark` tests comparing `range()` without
`repeat()` in 3.7 vs 3.8. This would analyze the impact of replacing a single
`AtomicLong` counter with a singleton `Map` of one counter entry.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]