Quote:
Originally Posted by buburuzu19
First of all i want to ask you if is it normally that "CallLocalFunction" to be called 1134199 times in an interval of 8 minutes. If not, how can i optimize this? What should i do to improve my server's performance. I have 500/500 players and i have an average of server ticks of 100 - 99. I don't have anything at OnPlayerUpdate.
|
500 players? Lets say on average, a player uses a command every minute. So 500 players will use, 500*8 commands which means CallLocalFunction is called 4000 times by ZCMD.
So its not because of the commands. Its your script which is doing shitlod of CallLocalFunction calls.
CallLocalFunction, in my opinion is the most useless function unless you are going to execute functions at runtime which are not known during compile-time (like ZCMD).
I can't think of any other reason why you would want to use CallLocalFunction in your script. CallRemoteFunction is acceptable since anyone could be using it for cross-script communication but CallLocalFunction?
I really doubt if you are even speaking the truth.
Lets say on average, a player sends 10 player updates per second. 8 minutes is equivalent to 480 seconds.
So total OnPlayerUpdate calls = 10 * 480 * 500 = 2,400,000 which is approximately twice the value you mentioned.
This is unimaginable that you have 1 million CallLocalFunction calls with your OnPlayerUpdate being empty.
Or you have an insane loop which executes CallLocalFunction too many times or you have a timer which runs every 50ms which makes CallLocalFunction calls.
Another seemingly legitmate explanation could be that "someone used a keybinder to spam commands". A keybinder can send around 25 commands per second.
A single player can send 12,000 commands per second. If each and every player used keybinder in your server to spam commands, then it will be just 6 million.
Even this possibility is ruled out.