[ 
https://issues.apache.org/jira/browse/TINKERPOP-887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15617097#comment-15617097
 ] 

Marko A. Rodriguez commented on TINKERPOP-887:
----------------------------------------------

A couple of more things:

1. You will need to create serializers for this in Gryo, GraphSON, and in 
Gremlin-Python.
2. You should make an example of this working. In your PR so we can see its 
usefulness. Provide a Gremlin Console session showing what the problem is now 
and how your PR makes this better.

Finally, if you want this enabled for all traversals either you do 
{{g.withStrategies()}} or the user updates the 
{{TraversalStrategies.GlobalCache}} to have it turned on all the time. Having 
it on all the time isn't necessary.

Regarding "performance impact" -- its more of a problem with "just more stuff" 
that interacts at the {{TraversalStrategy}} level. We are always trying to get 
rid of strategies (e.g. {{IdentityRemovalStrategy}} --- its "just a noop 
too!"). Less less less... not "thanks for adding things" cause guess who gets 
to maintain your one off idea -- exactly.



> FastNoSuchElementException hides stack trace in client code
> -----------------------------------------------------------
>
>                 Key: TINKERPOP-887
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-887
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: Bryn Cooke
>            Assignee: Marko A. Rodriguez
>            Priority: Minor
>
> I wrote some code that incorrectly assumed that a Gremlin query would return 
> an element, but it didn't. The surprise was that I got no stack trace and 
> therefore had no idea where in *my* code I had introduced the error.
> I haven't looked in detail at the TP code, so what comes next is speculation:
> If FastNoSuchElementException is being used in truly exceptional 
> circumstances then why is a singleton is used over a normal exception with 
> stack trace? It could just as easily be converted to a normal exception.
> If FastNoSuchElementException is being used for control flow then probably it 
> shouldn't. Code should check hasNext rather than trying for next and dealing 
> with an exceptional result. I'm not sure what the current state of things are 
> in the JVM but at least in the past try catch blocks would inhibit 
> optimization even without stack traces so this type of code was considered an 
> antipattern.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to