generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Efficiency

Previous Thread :: Next Thread 
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
16 Oct 2013 08:14 AM
Which is slower?

Cloning an instance or creating one
Report Abuse
zars15 is not online. 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
StealthKing95 is not online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
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 is not online. 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 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
16 Oct 2013 12:45 PM
I prefer :Clone()
Report Abuse
MHebes is not online. 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
SCP087Project is not online. SCP087Project
Joined: 29 Sep 2013
Total Posts: 198
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image