Why WeldConstraint less performant than Weld?

So, I have been trying to optimize my giant movable islands for 2nd day now.
My islands for testing have around 3.5k parts (Real ones can have 30k).
Main performance tanker was moving ONLY Island’s root part without moving all other parts. I have fixed this with making 1 extra root part, which is welded to main root part, which is welded to entire island assembly.

BUT HERE CAMES THE STRANGE THING:
When I move Second root part (that extra one), Weld and WeldConstraint has shown ABSOLUTELY 2 DIFFIRENT RESULTS:

  1. WeldConstraint dropped performance to 30 PUPS (physics updates per second)
  2. Weld not dropped performance at all - 60 PUPS

Tests above cover 2 scenarios - if entire island assembly will move, and won’t move. Performance results was the similar in both cases - exception was the performance loss - when entire assembly moved it was only 3 PUPS.

And I thought that complete replacement of all WeldConstraint with Weld will give me even better result! I was wrong at this part - no improvements occurred when I did that.
As result, I can say that there’s some overhead on WeldConstraint occurring, especially when assembly begins to move, or when assembly’s part wants to move without moving all other parts in assembly.

But why?

I’m not sure why WeldConstraints are less performant than welds, but why don’t you anchor all the parts in the model and use :PivotTo instead? They would remain in their correct positions and I assume this would lower the physics updates more.

Because WeldConstraints actually work

2 Likes

Funny answer and all haha we are all laughing but he did ask a question weld constraints are less performant because weld constraints continuously enforce the connection between two parts whereas welds just glues them together, weld constraints have to be solved every physics step unlike welds.

That is why.

3 Likes

TLDR:

Every physics step weld constraints are re-calculated unlike welds which are never recalculated.

Moving 1 assembly instead of a lot of anchored parts is like x100 more performant.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.