|
| 16 Oct 2013 08:14 AM |
Which is slower?
Cloning an instance or creating one |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 16 Oct 2013 08:26 AM |
| Well efficiency isn't just speed, it's how clever and neat you do it. So cloning instance would be more efficeint, than making new, because you wouldn't need to change all properties again, just few of them. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 08:43 AM |
| Well yeah, but im more after speed. Dealing with new instances every 1/30th of a second gets slow |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 16 Oct 2013 08:45 AM |
| Well there shouldn't be major speed difference. And 1/30 isn't really that bad. I'd go with clone. |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
| |
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 16 Oct 2013 01:39 PM |
| I would assume clone would be slower, since it has to call Instance.new anyways and would need to set every property of the object, rather than taking defaults and changing only ones you're specifying. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2013 01:43 PM |
You can test it by using tick()
Here's what I got:
> local start = tick() Instance.new("Part", workspace) local fin = tick() print(fin-start) 0.0002434253692627 > local start = tick() workspace.Part:Clone().Parent = workspace local fin = tick() print(fin-start) 0.00038027763366699 |
|
|
| Report Abuse |
|
|