[Neo4j] Concerning getting all nodes after a traversal

Michael Hunger michael.hunger at neotechnology.com
Tue Sep 27 22:39:56 CEST 2011


Can we take this to the mailing list ?

After all what is your usecase?

What is the structure of your graph, what your starting nodes, etc.
Do you have cold or hot caches.

I think probably the traverser is not limiting to the right set and traverses too much of the graph.

Cheers

Michael

Am 27.09.2011 um 20:41 schrieb Peter Neubauer:

> Daniel, 
> I think Michael has been testing some with these setups...
> 
> /peter
> 
> Sent from my phone.
> 
> On Sep 27, 2011 6:21 PM, "Daniel Morozoff" <danielmorozoff at gmail.com> wrote:
> > Hi Peter,
> > 
> > Thanks for your response. Makes total sense! Can you recommend any in memory
> > DBs like blackray that work well with neo4j and java?
> > 
> > Thanks,
> > 
> > Dan
> > 
> > On Tue, Sep 27, 2011 at 12:26 AM, Peter Neubauer <
> > peter.neubauer at neotechnology.com> wrote:
> > 
> >> Daniel,
> >> remember that the traversals are lazy, so nothing is traversed until
> >> you actually iterate. Is that explaining the difference? Also, try
> >> running the code several times, and the caches and the JVM will help
> >> to bring times down compared to cold runs.
> >>
> >> HTH,
> >>
> >> Cheers,
> >>
> >> /peter neubauer
> >>
> >> GTalk: neubauer.peter
> >> Skype peter.neubauer
> >> Phone +46 704 106975
> >> LinkedIn http://www.linkedin.com/in/neubauer
> >> Twitter http://twitter.com/peterneubauer
> >>
> >> http://www.neo4j.org - Your high performance graph database.
> >> http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
> >> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
> >>
> >>
> >>
> >> On Mon, Sep 26, 2011 at 9:54 PM, <danielmorozoff at gmail.com> wrote:
> >> > Hi Peter,
> >> >
> >> > I know you are one of the admins for the forums and I was wondering if
> >> you could assist me with my question. I posted it already on the forum, but
> >> have not received a response.
> >> >
> >> > My question pertains to running the getAllNodes() method on a Traverser
> >> object. It takes drastically longer to get all nodes than to traverse them.
> >> >
> >> > I assumed it was a indexing issue and decompiled the kernel lib file, but
> >> could not find where the indexing was occurring (as it was not in the
> >> Traverser class).
> >> >
> >> > Could you give me some input, as we are attempting to optimize our
> >> algorithms, but 95% of the speed comes from this one method.
> >> >
> >> > Here is a copy of my post:
> >> >
> >> > For your reference the size of the DB is ~6.8 Gb
> >> > ------------------------------------------------------------
> >> >
> >> > long startTime = System.currentTimeMillis();
> >> > Traverser treeTraverser = root.traverse(
> >> > Traverser.Order.BREADTH_FIRST,
> >> > operator.getStopEvaluator(),
> >> > ReturnableEvaluator.ALL,
> >> > relationshipType,
> >> > Direction.OUTGOING);
> >> >
> >> > long endTime = System.currentTimeMillis();
> >> >
> >> > System.out.println("\n||TIME NEEDED FOR TRAVERSAL:
> >> "+(endTime-startTime)+"
> >> > ms||");
> >> > int size = 0;
> >> > startTime =System.currentTimeMillis();
> >> > Iterable <Node> nodeCollection =
> >> treeTraverser.getAllNodes();
> >> > endTime = System.currentTimeMillis();
> >> >
> >> > System.out.println("\n||TIME NEEDED TO GET NODES: "+(endTime-startTime)+"
> >> > ms||");
> >> >
> >> >
> >> > -----------------------------------------------------------
> >> > Console output:::
> >> >
> >> > ||TIME NEEDED FOR TRAVERSAL: 63 ms||
> >> >
> >> > ||TIME NEEDED TO GET NODES: 56875 ms||
> >> >
> >> > ------------------------------------------------------------
> >> >
> >> > Thank you so much,
> >> >
> >> > Dan
> >> >
> >>



More information about the User mailing list