Suppose, I want to synchronize state of one part with another. Should I update all required properties or just re-create the part?
Either way should work unless you want to maximize performance.
Yes, I need good performance.
char limit
Updating them probably saves memory.
Are there any benchmarks that prove it?
Idk, but It just makes sense that updating it is more memory efficient because it can take the garbage collector a while to clear destroyed parts, while updating it doesn’t even need to destroy and recreate parts.
Technically, you will have to do more actions when you destroy. While updating, you will only update the specific stuff. When you destroy, you have to recreate it, doing more actions than just updating
You shouldn’t be concerned as even if its more efficient its not going to optimize your game to a point where you can see the difference
I am synchronizing a lot of parts every frame, so this is vital for me.
what is the context where the performance impact between re-creating or updating a part will matter?
Btw, is parenting to nil
before updating makes it any faster?
I want to create a portal system using ViewportFrame.
No.
FillerTextFillerTextFillerText
Are you sure?
charliiiiiiiiiiiiim
If anything, it slows it down.
Destroy is the same as setting the parent to nil
Actually, they are not exactly the same
Parenting to nil
doesn’t actually destroy the instance
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.