When a newbie developer sees this, it isn’t very helpful to just display percentages, because a newbie developer has no idea what percentage of his machine (gpu or cpu) is being used by the script, I myself am not even sure (though I believe its cpu?) what these stats are displaying. It would be extremely helpful if we could get a few extra details displayed such as:
CPU and RAM usage in kilobytes and not percentages, so we know the actual amount of processing power our scripts are taking up. This would be extremely useful as not every computer has the same specs, so if I’m only taking up 10% on my rig, I might actually be taking up 30-50% on someone else rig and have no idea my script is that taxing because I’m going off a percentage and not an actual number.
How would you go about measuring CPU usage then? Clock ticks per script? Even if you got an absolute number, how would you know what number is good for a different CPU?
Rule of thumb is if your script is always over 1-2% then optimise that, assuming you don’t bundle everything into one script for the entire game.
Unfortunately there is just no good way to measure the processing power required other than percentage of your particular CPU. To test how another CPU will handle it you have to run it using that CPU.
It could be useful to see the memory being used, which is a different metric, but is easier to get an absolute number. Although, you could easily do this yourself with collectgarbage(“count”). It would still be useful to just have easy access to this number. Although, I’m not sure if this stops the world to count or not (if someone could confirm or deny).