[REP++] Optimization tips & tricks help
#1

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.
Reply
#2

Most probably you are using some outdated hooking method (older ones work by using CallLocalFunction), for example at the OnPlayerUpdate (called really really much even for one player) in an include. Update your hooking methods: https://sampforum.blast.hk/showthread.php?tid=570910 .
Reply
#3

1 million calls for 8 minutes ? IN WHAT POSSIBLE WORLD IS THAT NORMAL ?
Sure if you are hosting GTA V:Online yeah it's normal
Look for it's calls, they might be under some unnecessary loop or as stuntman mentioned you might use it for hooking, which can be updated to be way lighter (all on compiling time, once for all the runtime).
Reply
#4

There is so much shit coming out your mouth I don't know if your face is your ass or your ass is your face 500/500 players pretty successful server yet you can't even solve or analyze a simplistic fundamental issue.
Reply
#5

Quote:
Originally Posted by Pottus
View Post
There is so much shit coming out your mouth I don't know if your face is your ass or your ass is your face 500/500 players pretty successful server yet you can't even solve or analyze a simplistic fundamental issue.
You are a little bit (actually more: a little byte *ba dum ts*) harsh there. But that's what also fascinates me: there are lots of newbies which actually have hundreds of players while lots of advanced scripters stay with under 100-50 players.
Reply
#6

It's not always about the script, huh.

Anyway, you'll need to get a scripter to have a look at your script, we can't help you without knowing where your script is unoptimized
Reply
#7

Quote:
Originally Posted by IstuntmanI
View Post
You are a little bit (actually more: a little byte *ba dum ts*) harsh there. But that's what also fascinates me: there are lots of newbies which actually have hundreds of players while lots of advanced scripters stay with under 100-50 players.
Yes that was quite harsh I mean I really have nothing against him but it is annoying to see people trying to big themselves up that obviously have nothing so I was pointing out the fact. In terms of his problem he didn't post any code at this point what help would you expect if you did that?
Reply
#8

Quote:
Originally Posted by buburuzu19
View Post
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.
Reply
#9

Quote:
Originally Posted by Yashas
View Post
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.
It doesnt matter if his OnPlayerUpdate is empty, it's probably a hook from a not well written include or something.
Maybe even more than just one hook, that number of calls is not hard to achieve with that many players.
Reply
#10

Quote:
Originally Posted by Pottus
View Post
There is so much shit coming out your mouth I don't know if your face is your ass or your ass is your face 500/500 players pretty successful server yet you can't even solve or analyze a simplistic fundamental issue.
I started believing this stuff after I saw someone from my country translate SFCNR's released gamemode and started a server with 200 online players, sold OWNERSHIP ( ! ) for ~300$ (which he sold at least 20 I think), so actually It's quite possible for total noobs to make a successful server with most crappy scripts, it's the luck factor kicking in.
Reply
#11

Quote:
Originally Posted by NaS
Посмотреть сообщение
It doesnt matter if his OnPlayerUpdate is empty, it's probably a hook from a not well written include or something.
Maybe even more than just one hook, that number of calls is not hard to achieve with that many players.
I did mention it , he could probably be having a timer of 50ms and that timer makes a CallLocalFunction call for each of the 500 players.

But that is probably not the case. I can't think of any place where I could use CallLocalFunction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)