Heya, I’m aware for script performance, scripts should not exceed 3%. However, when using single script architecture, and therefore every system linking into one script, taking the form of modules, is this still the case?
I have my client script sometimes peaking 10%-13%, and sitting at a good 8%-9%, but this is with the entire game almost finished, and every module linking to it. Should I be concerned? Since roblox doesn’t really have viewing of module script performance, how can I figure out whats causing the root if this is infact bad?
I’m not aware if those percentages will cause issues, I highly doubt it, but if your system is high-end it might be worth checking on a mobile device just to be safe.
If you want to test where performance issues are occurring, you can use debug.profilebegin() and debug.profieend() It will allow you to see how long certain parts of your code are taking to execute in the Micro-Profiler
Here’s an example:
debug.profilebegin("GarbageWork")
while task.wait() do
for _, 10000, 1 do
math.sqrt(math.random(1, 1000))
end
end
debug.profileend()
This will document how long this action takes each frame, and will tag it with “Garbage Work.” in the Micro-Profiler This works in modules, as long as this occurs in functions. More documentation on this can be found here:
Yes, this makes sense. My game is restricted to PC players anyway, I was more worried since it is expected to have servers of 100+ people, although, I have kept it as optimized as can be to my knowledge, but the percentages threw me off since we don’t have much documentation on those.
Thank you for the Micro-Profiler tips, if performance becomes an issue, I will use this, it will take a while since there are a lot of modules but I suppose it is the best way.