Does anyone know the cost of Loop’s on the player’s FPS? Because I’m making a game that I want everyone, soon to be mobile and console, to play my game. I also want to completely minimize the number of recourses being used on the client’s device.
By Loops, I’m reffering to For i, I pairs / In Pairs, RunService.Heartbeat(), tick()os(), etc…
I know that every loop will vary in the cost of recourse’s being used though. I saw a chat on the forum once that was describing the differences of the loop-able functions, and how they differ in the consumption of the client’s recourses.
Each loop can have a print() function in it, but all of the loops will differ in the amount of recourse’s used and also will go at different speeds.
Most of your examples aren’t loops so I’m not sure about that—if you need Heartbeat or Stepped for something, you have to use it.
There is no good general answer to your question.*
First, use the tool you need to use. There’s no choice there.
Then, see if you even have a performance problem in the first place. No performance problem? No need to worry about optimizing.
Finally, only once you’ve confirmed you have a performance problem on real devices, realize that your performance problem is not due to the exact type of loop you used and look elsewhere.