Github user BrynCooke commented on the issue:
https://github.com/apache/tinkerpop/pull/470
Exactly. It's currently a huge pain to figure out where things have gone
wrong. Without this patch I have to divide and conquer my code every time I hit
a FastNoSuchElementException.
There is no cost to a try/catch block. The construction of the regular
NoSuchElementException is expensive, but should only be thrown on the top level
traversal.
I actually found no significant difference between branches in terms of
performance.
Mine
```
gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(gryo()).readGraph('data/grateful-dead.kryo')
==>null
gremlin> h = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> g = graph.traversal().withoutStrategies(LazyBarrierStrategy.class)
==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> clock(100){ h.V().out().out().out().toSet() }
==>3.33155785
gremlin> clock(20){ g.V().out().out().out().toSet() }
==>520.2727724499999
gremlin> clock(20){ g.V().out().flatMap(out()).flatMap(out()).toSet() }
==>903.5254189999999
gremlin> clock(100){ g.V().repeat(out()).times(3).toSet() }
==>1.8392006699999999
gremlin> clock(100){ h.V().count() }
==>0.0069826
gremlin>
```
Master
```
gremlin> graph = TinkerGraph.open()
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(gryo()).readGraph('data/grateful-dead.kryo')
==>null
gremlin> h = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> g = graph.traversal().withoutStrategies(LazyBarrierStrategy.class)
==>graphtraversalsource[tinkergraph[vertices:808 edges:8049], standard]
gremlin> clock(100){ h.V().out().out().out().toSet() }
==>3.59260972
gremlin> clock(20){ g.V().out().out().out().toSet() }
==>519.7500263
gremlin> clock(20){ g.V().out().flatMap(out()).flatMap(out()).toSet() }
==>907.32923195
gremlin> clock(100){ g.V().repeat(out()).times(3).toSet() }
==>1.76869779
gremlin> clock(100){ h.V().count() }
==>0.006985369999999999
gremlin>
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---