Ok, if you reverse the order. I feel like the results are very inconsistent
code:
local Create = require(game.ReplicatedStorage.Packages:WaitForChild("SmartCreate")).Create
task.wait(5)
local start = os.clock()
for i = 1, 1000 do
--Setting the property of part
local Part = Instance.new("Part")
Part.Name = "Smart"
Part.Color = Color3.fromRGB(255,255,255)
Part.CFrame = CFrame.new(1,10,0)
Part.Anchored = true
Part.CanCollide = true
Part.Size = Vector3.new(2,10,2)
--Setting the attributes of part
Part:SetAttribute("IsTouched", false)
Part:SetAttribute("DefaultSize", Vector3.one)
--Setting the Touched Event of the part
Part.Touched:Connect(function(otherPart)
print(otherPart.Name .. " touched!")
end)
--Setting the child of the part
local Head = Instance.new("Part")
Head.Name = "Head"
Head.Size = Vector3.new(5,5,5)
Head.Anchored = true
Head.Parent = Part
Part.Parent = workspace
end
print(os.clock() - start .. ": Roblox's time")
task.wait(5)
local start = os.clock()
for i = 1, 1000 do
Create("Part", {
Name = "Smart",
Parent = workspace,
Color = Color3.fromRGB(255,255,255),
CFrame = CFrame.new(1,10,0),
Anchored = true,
CanCollide = true,
Size = Vector3.new(2,10,2),
Attributes = {
["IsTouched"] = false,
["DefaultSize"] = Vector3.one,
},
Touched = function(otherPart)
print(otherPart.Name .. " touched!")
end,
Children = {
Create("Part", {
Name = "Head",
Size = Vector3.new(5,5,5),
Anchored = true
})
},
})
end
print(os.clock() - start .. ": SmartCreate's time")