did a quick test to demonstrate that if you stay API-only, you get  
speed improvements.  so, you'll see these kinds of speed boosts  
throughout your scripts.

import time
p = PyNode('perspShape')
a = time.time()
for i in range( 10000 ):
        p.getFocalLength()  # this wraps the API
b = time.time()
print b-a
0.20265007019

0.0136308670044
a = time.time()
for i in range( 10000 ):
        getAttr( 'perspShape.focalLength' )
b = time.time()
print b-a
1.10135388374


On Mar 16, 2009, at 2:57 AM, Drake wrote:

>
> In order to figure out the boost of performance migrating from 0.7 to
> 0.9,
> I did a quick test by following code snippets:
>
> -------------------------------------
> from pymel import *
> import time
> a = time.time()
> allNodes = ls()
> b = time.time()
> print b-a, len(allNodes)
> -------------------------------------
>
> And it turns out:
> -------------------------------------
> 0.9RC5: 14.110008955 49798
> 0.7.9:  0.54513502121 49798
> -------------------------------------
>
> Environment: Maya 8.5 sp1 x64 in Linux (Ubuntu 8.04)
> ---------------------------------------------
>
> I guess the overload comes from initialization of classes but not sure
> yet.
>
> - Drake
>
> On Mar 13, 3:36 pm, Chadrik <[email protected]> wrote:
>> RC5 is posted.  this should be the last one.  8.5 should be fairly
>> well supported now, except for the API undo.
> >


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to