Hey Kevin, > g.v(293).in.drop(5).take(5) > > and > > g.v(293).in[5..9] > > (Both return the same, correct result set) > I will be doing some performance tests today on the two, but last week when > I tried them both on fairly heavy queries, the second method seemed faster > (I only say "seemed", because I'm hesitant to draw conclusions before I've > properly measured the times)
I've never seen drop() and take() until I saw Peter do it in the Gremlin documentation. I do not recommend using any of Groovy's collection methods because they tend to NOT be lazy. The range filter [5..9] is native Gremlin and lazy/stream-based without intermediate collection construction. In general, do not use: collect{} each{} drop()/take() ... Gremlin will have its own lazy version of such constructs and those should be used. Enjoy, Marko. http://markorodriguez.com _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user