Optimizing Mass Part Spawning for Procedurally Generated Terrain

you can speed up process by like 10% with RawLib
Also you could cache “common part” with most mutual properties and then just do:

Instance.fromExisting()

yes you got me right Instance.fromExisting() NOT :Clone()
Other than that there pretty much nothing to make it more optimized
Also you can try using :PivotTo() + combined with RawLib it would be even faster
Proofs: Can someone verify this benchmark?
Example:

local RawLib = require("./RawLib")
local instance_index = RawLib.instance_index
local instance_newindex = RawLib.instance_newindex
local commonPart = Instance.new("Part")
local PivotTo = instance_index(commonPart,"PivotTo")::(PVInstance,CFrame)->()

local copy = Instance.fromExisting(commonPart)
PivotTo(copy,CFrame.identity)
instance_newindex(copy,"Parent",workspace)

1 Like