(Credit to zeuxcg and fractility for picture and information)
I HIGHLY recommend you read this, as it contains knowledge most people don't know.
How tasks and threading works in ROBLOX
So, whats in this image you may ask.
Well, lets look at the top part first.
(This post was made for users with experience using Lua)
Basically, RenderStepped is a signal that fires every frame, before the actual rendering happens, so if you bind intensive code to or use
RenderStepped:wait();(That's not actually how you call a renderstepped wait function) with intensive code, it will prevent ROBLOX from rendering the next frame.
So what should I use RenderStepped for?
Well basically, you should only use RenderStepped for things that need to happen before the frame is rendered, like camera events, certain things like making a part appear glued to the camera, etc.
Heartbeat is much like
RenderStepped, only it runs while the Render thread is running. It runs at the same rate as your frame rate, and it runs after Physics.
Zeuxcg, a technical director at ROBLOX explained in a rbxdev forum post about how Heartbeat is essentially a much more efficient version of RenderStepped.
Basically, if you need to run a loop at 60 hz instead of 30 hz, you should use Heartbeat as it allows ROBLOX to render the current frame and run physics before your potentially intensive code in Heartbeat.
Stepped, runs before physics and will fire every one frame
Only use RenderStepped for things that absolutely have to be ran before the next frame, such as making a part constantly set to be infront of the camera. Use Heartbeat instead (runs at game's current frame rate) for things like loops that need to be ran up to 60 times a second (as apposed to 30 that the normal wait() function does), and that also wont have their functionality ruined if its behind one frame.
So basically, RenderStepped should not be taken lightly, Stepped runs before Physics, and Heartbeat runs after Physics.
References / Sources:
(besides my general knowledge )
Zeuxcg (technical director @ ROBLOX)
FYI, I'm @craftsmashbuild on twitter and post technical things like this frequently.