Memory leak help

I don’t think it’s a good idea using the second (Parent) argument of Instance.new. Refer to the following:

Basically, I think it would be more efficient if you set the parent of the part at the very end (after you set the properties of the Instance). I believe this would lead to a reasonable boost in memory and performance.

Example:

local Part = Instance.new("Part")
Part.Name = "part"
Part.CFrame = CFrame.new()
...
Part.Parent = workspace
3 Likes