Yes, possibly it's because it retrieves the MObjects and MDagPaths from the strings that cmds.ls() actually returns. Then it will have to query it's database to attach the respective function sets to the object ( and possibly more ). This makes each API wrapped object quite an expensive little fella ;).
Once more this shows that you either get speed at the expense of convenience for the programmer or you sacrifice it. On Mon, Mar 16, 2009 at 10:57 AM, Drake <drake.g...@gmail.com> 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 <chad...@gmail.com> 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 -~----------~----~----~----~------~----~------~--~---