2011/9/10 Linan Wang <tali.w...@gmail.com>

> Andreas,
> thanks. can't wait for your result.
> one correction on my list:
> Retrieve a certain types of relationships of a node should be faster
> than retrieve all. i mis-read the source code in NodeImpl.java, in
> which "private volatile RelIdArray[] relationships" is an array of
> array.
>
> the updated list:
> 1, Read id of a node/relationship.
> 2, Read property value of a node/relationship.
> 3, Set property value of a node/relationship.
> 4, Retrieve a node/relationship by id.
> 5, Create a new node/relationship.
> 6, Retrieve a node by external id from node index.
> 7, Retrieve a certain subset of relationships of a node from
> RelationshipIndex.
> 8, Retrieve all relationships of a node.
> 9, Retrieve a certain types of relationships of a node.
> 10, Add a node to index.
> 11, Add a relationship to index.
>
> could anyone confirm that to iterate relationships of a node,
> Node.getRelationships() is faster than using
> RelationshipIndex.get(KEY, VAL, node, null)? thanks
>

For Node#getRelationships(): i.e. get all, not of any particular type,
Node#getRelationships should always be faster.

If you however call Node#getRelationships(someType) or any of the methods
specifying one or more types and compare that to a rel index query with a
specific type the answer isn't as straight forward: If you've got a warm
cache (i.e. all relationships for that node have been loaded once before)
#getRelationships is faster than going through an index. If the node isn't
warm it depends on how many relationships out of the node's total amount of
relationships you'd like to retrieve. If it has many relationships and
there's only a few of that type then it would load many relationships that
weren't relevant for your request. The index would only load the required
relationships and would hence be faster there.

>
> On Sat, Sep 10, 2011 at 1:46 AM, Andreas Kollegger
> <andreas.kolleg...@neotechnology.com> wrote:
> > Hi Linan,
> >
> > These are good questions. I am currently following a similar approach to
> characterizing the performance of basic graph operations, and then also
> simple graph algorithms on various "shapes" of graphs. My initial
> investigation is on small graphs on my laptop, but this weekend I'm testing
> large graphs on Amazon instances (large, as in > 500 million nodes).
> >
> > I'll post the summary of my findings from this weekend, then continue to
> elaborate on the operations and different server configurations.
> >
> > Best,
> > Andreas
> >
> > On Sep 9, 2011, at 4:29 PM, Linan Wang wrote:
> >
> >> hi,
> >> I once read a blog about how long it take for computation operations
> >> such as read from L1 cache, RAM access, send packet from usa to eu,
> >> etc. having a rough idea of the relative cost of major computation
> >> operations, we have better control. for example, in my project i also
> >> use property to store a cityid apart from create a relationship
> >> between user to city, because if reading an int property is 10x faster
> >> than getSingleRelationship + relationship.getEndNode + cityNode.getId.
> >>
> >> I'm wondering if could having similar list for neo4j operations. I
> >> understand some operations could be faster than another depending on
> >> different conditions. but let's only focus on basic read/write
> >> operations.
> >>
> >> below is my guess, from fastest to slowest, feel free to correct me
> >> and add more.
> >>
> >> 1, Read id of a node/relationship.
> >> 2, Read property value of a node/relationship.
> >> 3, Set property value of a node/relationship.
> >> 4, Retrieve a node/relationship by id.
> >> 5, Create a new node/relationship.
> >> 6, Retrieve a node by external id from node index.
> >> 7, Retrieve all relationships of a node.
> >> 8, Retrieve a certain subset of relationships of a node from
> RelationshipIndex.
> >> 9, Retrieve a certain types of relationships of a node.
> >> 10, Add a node to index.
> >> 11, Add a relationship to index.
> >>
> >> --
> >> Best regards
> >>
> >> Linan Wang
> >> _______________________________________________
> >> Neo4j mailing list
> >> User@lists.neo4j.org
> >> https://lists.neo4j.org/mailman/listinfo/user
> >
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Best regards
>
> Linan Wang
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to