ITdreamer Posted January 15, 2011 Share Posted January 15, 2011 Hi, friends I am trying to choose the language to write SOP operator between VEX and Python? When the operator on one of these languages will be finished the i'll write it on C++. But for now I want to know what SOP on VEX or on Python will be faster? This SOP will work with large amount of points and its attributes. Thanks Quote Link to comment Share on other sites More sharing options...
anim Posted January 15, 2011 Share Posted January 15, 2011 VEX will be much faster, but it's limited to just modifying attributes on points (no topology changes) and it's based on SIMD so passing data from previously computed point to next is not possible unless you compute the whole hierarchy for each point and then the speed may be slower than python and VEX is also multithreaded for large amount of points Quote Link to comment Share on other sites More sharing options...
ITdreamer Posted January 15, 2011 Author Share Posted January 15, 2011 VEX will be much faster, but it's limited to just modifying attributes on points (no topology changes) and it's based on SIMD so passing data from previously computed point to next is not possible unless you compute the whole hierarchy for each point and then the speed may be slower than python and VEX is also multithreaded for large amount of points And there is no way to get attribute value from the other point, rather then the processing point? Looks like i can do this, I've seen import() function where I can specify the point number to take attribute value from. Quote Link to comment Share on other sites More sharing options...
anim Posted January 15, 2011 Share Posted January 15, 2011 yes, you can import value from other than current point easily, but it will get the value from that point on input geometry so if you cannot expect to change point 0 and in the same VEX trying to import that new value from point 0, it will import old value, as it was on input geometry this is because SIMD architecture where all points are executed parallel so there is nothing like this point was run first so I can get its value in next point, and that's the reason it multithread that well, the points are not dependent on each other it's just to keep this in mind, that you cannot use VEX for every case if you for example want to get maximum value of any attribute for all points and then use it in each point, you cannot do it effectively in single VEX, with a little thought multiple VEX nodes can be faster than python solution for such cases, but if you need many operations of such nature, python would give you much more freedom especially if you are planning for C++ rewrite Quote Link to comment Share on other sites More sharing options...
symek Posted January 15, 2011 Share Posted January 15, 2011 Hi, As anim said, VEX is usually many times faster than Python, specially while looping (where hom creates many objects, not just calls c++ api which lays underneath python). But VEX can also be very limiting, specially with more elaborated algorithms. On the other side, current Python implementation in Houdini not only has inlinecpp* module - allowing you to place c++ snippets inside Python node - but also can execute VEX code inside Python**, which is really neat, if you have a big vector (array) of floats you want to process with VEX machinery with a speed probably superseding c++. hth, skk. * - http://www.sidefx.com/docs/houdini11.0/hom/extendingwithcpp ** - http://www.sidefx.com/docs/houdini11.0/hom/hou/runVex Quote Link to comment Share on other sites More sharing options...
ITdreamer Posted January 15, 2011 Author Share Posted January 15, 2011 Thank you for answering. I'll try it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.