Jump to content

What faster VEX of python?


ITdreamer

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...