Help on slow attribute copy

wout w.ruijter at alumnus.utwente.nl
Wed May 18 19:39:04 EDT 2005


bgs wrote:

>There's no way that loop takes fifteen minutes just because of the dot
>operator.  I mean, 200000 dots in 15 minutes is 200 dots/second.  On a
>1 GHz machine, that would be 5 million cycles per dot.   That does not
>seem reasonable (assuming you haven't overridden the dot operator to do
>something more complicated than normal).
>
>Check that i.label does not have __hash__ overridden in a bad way.  I
>tried a test case with __hash__ overridden to always return the same
>integer, and I got performance about what you are describing when I
>tried your example loop with 100000 iterations.
>
>And, of course, make sure you are not low on memory and relying too
>heavily on swap space.
>
>  
>
bgs,
thanks for the quick reply
I don't think it's due to the .label, maybe too, but when I take it out 
it is still slow (due to the .coordinate)
here's the abaqus stuff:
 >>> print mdb.model['Model-1'].rootAssembly.instance['blok'].nodes[1]
({'coordinate': (3.01000022888184, 5.01000022888184, 0.53123539686203), 
'coordinates': (3.01000022888184, 5.01000022888184, 0.53123539686203), 
'instanceName': 'blok', 'label': 2})
 >>> nodes = mdb.model['Model-1'].rootAssembly.instance['blok'].node
 >>> for i in nodes:
...       dummy = i.coordinate
wait for half an hour....
The machine is p4 with 1GB ram so should be ok,
running fedora 3

Thanks
Wout

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the Python-list mailing list