Pufferfish: is tween curve over surface parallelized?

Hi @Michael_Pryor, do you think I would see any benefit parallelizing (if possible) your marvelous “tween two curves on surface” using ghpythonlib.parallel + nodeInCode? Is this component already parallelized under the hood?
I’am figuring out how to speed up those 600ms+600ms of computation time for more “real-time” user experience.

Hi @aitorleceta , Firstly it seems you are using an older version of Pufferfish (Refit is no longer a boolean but is instead a refit value integer).

Parallel in this case will not speed it up because tween two’s Curve A, Curve B, and Factor inputs are item level input types like Grasshopper’s tweens, meaning parallel or not the component executes the entire code for each factor.

The code will be much faster if you use the “Tween Through Curves on Surface” component because the Curve and factor input are evaluated as list level inputs and the entire code is executed once to get all the tweens. Currently, those components are not multi-threaded but they will be in next versions when I stop supporting Rhino 5 (R5 is a bit wonky with multi-threading and often not safe), even so, for now you should switch to “Tween Through Curves on Surface”, the “Tween Two Curves on Surface” component only really exists for a different kind of data structure setup that from the looks of your screenshot you don’t need.

As far as using ghpythonlib.parallel + nodeInCode I am not sure as I didn’t try it but I suspect it would perform the same as the “Through” component. Multi-Threading is tricky because it can actually be slower depending on how many processes you are going to perform as well as how good your hardware is. Hope that helps.

1 Like

oh my…


1 Like

Great! and the newest version has some new options.

thanks, I’ll inmediately try