That would make sense, I think, since cmds.ls() would be an entirely C++ call, where as replicating its functionality in the python api would involve more python overhead. In general, I think any SINGLE cmds.X() call is going to be faster than what you could equivalently implement in the python api.
On Tue, Oct 18, 2011 at 5:13 PM, Serguei Kalentchouk < [email protected]> wrote: > It depends on what you are trying to do. > A while ago I wrote a tool that was processing a lot of animation data > and dealing with lots of keys was significantly faster using Python > API calls than the commands. > However, doing cmds.ls (type = "joint") is also significantly faster > than the Python API equivalent. > > Cheers! > > On Tue, Oct 18, 2011 at 4:58 PM, Emre Yilmaz <[email protected]> wrote: > > This whole discussion is making me curious, does anyone know what of > Maya's > > API code is hardware accelerated? Obviously Maya makes heavy use of the > > graphics card in general. But I'm wondering if some relatively agnostic > use > > of the API like, say, a bunch of MVector normalizations or MMatrix > > multiplications, would also run partly on the graphics card. I've always > > assumed yes, but I don't recall if I've ever found out definitively. > > > > If so, the API could be faster in general, but if you had a lousy > graphics > > card and an amazing CPU, you might not see the same difference you'd see > > with a great graphics card and a lousy CPU. > > > > Just curious! > > > > On Tue, Oct 18, 2011 at 4:33 PM, seb paviot <[email protected]> wrote: > >> > >> for what it's worth, I've been doing some mass parsing of scenes > >> lately, querying UVs and Colors on a per vertex basis. > >> I used the python cProfiler module to measure some differences between > >> pure python commands and moving the choke points to the API. In my > >> case it was a major gain to move to the API (roughly about half the > >> processing time compared to using just regular maya commands). > >> In your case though, if you're just talking about math conversion and > >> you don't need to iterate over Maya internal data, I am not sure you > >> would gain a lot? I could be wrong though. > >> As Ravi said, try to measure the difference using cProfiler if you can > >> implement a quick API version. > >> > >> On Oct 17, 6:05 am, André Adam <[email protected]> wrote: > >> > Hi there, > >> > > >> > in general, are the Maya API(2) classes considered to be faster than > >> > calling equivalent native Python classes? Like, using the MAngle class > >> > for radian to degree conversion instead of Python's math.degree()? I > >> > am calling that per frame, so performance is a factor here. > >> > > >> > Thanks in advance for any insight you can share! Cheers! > >> > > >> > -André > >> > >> -- > >> view archives: http://groups.google.com/group/python_inside_maya > >> change your subscription settings: > >> http://groups.google.com/group/python_inside_maya/subscribe > > > > -- > > view archives: http://groups.google.com/group/python_inside_maya > > change your subscription settings: > > http://groups.google.com/group/python_inside_maya/subscribe > > > > > > -- > Technical Director @ Digital Domain > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
