Re: AddEdge

5 views
Skip to first unread message
Message has been deleted

Eytan Adar

unread,
May 29, 2009, 12:06:01 PM5/29/09
to guess-...@googlegroups.com
It's the difference between batch LOAD operation, and many small SAVE operations.  When you load the GDF file it only has to instantiate the objects in memory and can do those pretty quickly.  Whenever you create an edge it saves the edge to the database, and then sets all the attributes (requiring a save on each one).  I'm not sure I can offer a workaround that would make any real difference in the end... there are tricks to delay the database commit stage which might make it a tiny bit faster.

-Eytan

On Fri, May 29, 2009 at 7:12 AM, Mass...@gmail.com <Mass...@gmail.com> wrote:

Hello,
I have written a script for adding edges manually:

def createEdges(node_src, destinations):
       node1 = eval( 'v' + str(node_src) )
       n = len(destinations)
       for i in range(n):
               node2 = eval( 'v' +str(destinations[i]) )
               try:
                       addEdge(node1,node2)
               except:
                       a=None

Does anyone know why it is much slower than adding edges using a GDF
file?
Does addEdge() do some verifications ?

Thanks,
Massoud


Message has been deleted

Eytan Adar

unread,
Jun 1, 2009, 6:10:12 PM6/1/09
to guess-...@googlegroups.com
makeFromGDF uses more or less the same code as the bulk loader, so it should work... I think it's in the com/hp/hpl/guess/io directory.

There's probably a better way to do this, but I'd need to think about it...

-Eytan

On Fri, May 29, 2009 at 1:31 PM, Massoud SEIFI <mass...@gmail.com> wrote:
Thank you Eytan for your fast reply.

Is there any way to do a batch LOAD operation using a script?
I couldn't find the source code of makeFromGDF() function to find out how it works.
Reply all
Reply to author
Forward
0 new messages