Hello,
I saw that BindToRenderStep uses 3x the performance as RenderStepped?
Meanwhile using loops in the game I prefer using RenderStepped since while true do wait() which is doing exact same takes 2x the performance as just doing a RenderStepped loop.
Does anyone know how to make it even better?
I don’t know why BindToRenderStep would have any performance difference from RenderStepped. They do pretty much the same thing except I think one lets you specify a name and priority. Whichever it is, the performance to actually call your script should be much less than your actual script uses.
BindtoRenderStep function()
print()
end
takes more performance then just doing
renderstepped function()
print()
end
I don’t know what you mean by this since its not a valid program. I don’t think you need to worry about this performance difference.
I am just asking why overall RunService.BindToRenderStep takes more Performance than using RunService.RenderStepped.
Its almost impossible to know, since you’d have to know how its written on the Roblox side.
they should be the same
where did you get that from
The performance is based on what calculations you are running within each one.
You really shouldn’t be worrying about performance like this unless it’s ABSOLUTELY necessary.
These things are fundamental parts of making a game, and stressing over absolutely miniscule performance differences is only going to drive you crazy for no reason.
I got that information by testing around with ScriptProfiler.
It is ABSOLUTELY necessary for me because I am working currently for a game called [VENGEFUL SHADOW] Chakra Battlegrounds - Roblox
I was hired to fix Performance.
You need to profile to figure out which things are using most of the time and decide which are the easiest to fix.
Well, I am saying test out BindToRenderStep and RenderStepped and add the same function inside it, you will see there’s a huge difference in performance.
Even tho both are running at the same TIME
If this difference is big enough to be significant relative to the entire time spent running scripts in a game, then both of them would be a really bad implementation. If you have questions on profiling a game you could create a new topic to ask about this.
I don’t have questions about profiling a game,
I am having questions on why RenderStepped is using less performance then BindToRenderStep even tho they are exactly the same…
And why RenderStepped is using less performance then while wait() do, even tho RenderStepped is calling the things more often than the others.
wait() pauses the script until the scheduler decides to resume it, which may not be the same as when RenderStepped would have decided to resume it. It will also not happen at the same time relative to other steps in updating. RenderStepped also gives you the ability to control order precisely. You can also unbind it from any other script, since it gets attached to a string name, whereas RenderStepped creates a connection, which you need to have access to in order to cancel it.