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, Massou...@gmail.com <Massou...@gmail.com>wrote:
On Fri, May 29, 2009 at 6:06 PM, Eytan Adar <eytana...@gmail.com> wrote:
> 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, Massou...@gmail.com <Massou...@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 ?
On Fri, May 29, 2009 at 1:31 PM, Massoud SEIFI <massou...@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.
> On Fri, May 29, 2009 at 6:06 PM, Eytan Adar <eytana...@gmail.com> wrote:
>> 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, Massou...@gmail.com <Massou...@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 ?