cwhite
The VEX code itself is changing on each iteration due to the expressions, so that causes significant overhead from recompiling the code. You can use the Bindings tab as an alternative approach (see attached file)
this seems not be the case anymore in Houdini 19.0 and later.
Now, using that hscript expression directly inside a wrangle doesn't cause any overhead any longer.
The expression is:
v@asd`ftoa(detail(-1, "iteration",0))`
I couldn't find anything about it in the change-log, but I guess it was fixed.
================================================
================================================
Original Post:
Have a look at the setup in the .hip file.
There's a for-loop that creates 40 different vector attributes with a point wrangle.
Another for-loop does exactly the same with an 'attribute create' node.
Wrangle method is like 100 times slower on my system than 'attribute create' node, and I wonder why.
I guess single task-specific nodes are super optimized for the task and are generally preferable than multi-threaded wrangles.
Also, if you click on node info on the foreach_end you can see that the Memory consumption is much greater for the wrangle loop.
This leads to my second question: what does the Memory information means? Is the Ram needed to do the cooking on that particular node? And what does it means when 2 values are shown, "Memory" and "New"?
Another interesting find: try to increase the size of the 'attrib create' node from 1 to 4.
You will see that the memory consumption will stay fixed until size 3. And it will once you set the size to 4.
If you try to create a f, u, v, p attrib in the wrangle, the Memory consumption will increase accordingly.