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 » Scripters
Home Search
 

Re: How fast does a script run?

Previous Thread :: Next Thread 
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
06 Sep 2012 01:08 PM
If I have a super-long code with no wait() in one script, and another script with one line of code, do they both start and finish at the same time?
Report Abuse
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
06 Sep 2012 01:09 PM
Let me rephrase that,

one script is super long, another is super short, both scripts have no wait() in them.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
06 Sep 2012 01:19 PM
They won't finish at the same time.
The long one will take a small amount of time. Around 2000 lines (like Anaminus' Hyperspace Cruiser) will take around 3-5 seconds.
Small one seems instant.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
06 Sep 2012 02:12 PM
Scripts can't run instantaneously [not short and especially not long].

If they did there would be no such thing as encryption and there would be no such thing as electronic banking, waiting for your computer to start up, network latency, low framerates, expensive processors, etc.
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
06 Sep 2012 02:19 PM
@Blue;
But isn't some of that constrained to hardware restrictions?

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☜☆☞▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ - Candymaniac, a highly reactive substance.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
06 Sep 2012 02:23 PM
That's exactly my point. If you're making scripts run in constant-speed no matter what you are violating fundamental parts of how the universe works like Light Speed.
Report Abuse
Priminal is not online. Priminal
Joined: 02 Sep 2012
Total Posts: 18
06 Sep 2012 02:29 PM
This would depend on what type of computer, RAM, how fast the servers are and other variables to part with.
Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
06 Sep 2012 02:50 PM
I guess by the amount of work the script has to do.
Report Abuse
RA2lover is not online. RA2lover
Joined: 09 Nov 2008
Total Posts: 1254
06 Sep 2012 04:01 PM
all answers are wrong.

the first script to complete is the one who got first on the thread execution queue.
this means the short script can finish running AFTER the long one.
Report Abuse
TaslemGuy is not online. TaslemGuy
Joined: 10 Jun 2009
Total Posts: 12174
06 Sep 2012 04:04 PM
@RA

They're executed in parallel.

I'm not exactly sure how Studio parallelizes them, but your statement is fundamentally wrong.
Report Abuse
MrHistory is not online. MrHistory
Joined: 30 Aug 2010
Total Posts: 5291
06 Sep 2012 04:05 PM
If scripts ran instantaneously, we would be in Star Wars by now
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
06 Sep 2012 04:05 PM
@Mr;
But they don't because of hardware constraints.

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
Seranok is online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
06 Sep 2012 04:05 PM
> They're executed in parallel.

According to stravant, that statement is false, since Lua doesn't really have true multi-threading. If one script has a wait() statement then most likely the other script will start (and finish) running before the original script resumes.
Report Abuse
TaslemGuy is not online. TaslemGuy
Joined: 10 Jun 2009
Total Posts: 12174
06 Sep 2012 04:06 PM
@Seranok

Lua doesn't implement the calling. The Roblox server does, which I assume is built in C, which DOES has true multithreading.

Even with Lua's light threads, you can still do "multithreading" in Lua to execute in parallel, you just get 0 speed gain.
Report Abuse
Seranok is online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
06 Sep 2012 04:08 PM
My experience disagrees with that.
Report Abuse
RA2lover is not online. RA2lover
Joined: 09 Nov 2008
Total Posts: 1254
06 Sep 2012 04:18 PM
Roblox only runs ONE script at a time.

wait() halts that script's execution and tells roblox it can execute another one.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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