• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Slowness of execution
#1
Hi, I have a problem the first action that I posted on my server (whether local or on VPS) is long to execute whether it is a simple SendClientMessage or other.

Do you have an idea where this can come from?

PS: I updated all the include / plugin I use
  Reply
#2
It takes long for a resource to execute on server, right?



Must be due to hardware problem either gamemode is broken at all and needs optimization - is your gamemode in function on ini by any chance?
  Reply
#3
(2019-05-12, 08:20 PM)unix Wrote: It takes long for a resource to execute on server, right?



Must be due to hardware problem either gamemode is broken at all and needs optimization - is your gamemode in function on ini by any chance?



that it is on windows or vps the problem is percistant while after executing the first resource my gamemode works very well
  Reply
#4
Is there any specific part of your script which behaves this slow, or is it the entire script? What timers are you running and how often?
  Reply
#5
There are a few techniques which I use whenever I want to test the efficiency of the script.

Firstly, I check the server tick-rate using GetServerTickRate(), it can be assumed as the FPS of the server just like FPS of a game, usually the tick-rate is around 200 when performing the best, by around + 15 this means around 185-200 range.

Now, you can run the profiler plugin for a while and put as much as load as possible, either using script to fake players or bots, depending on the result, you take an action. For example, you disable all the timer related code and then test the script with the same tick-rate method and re-write whatever code is necessary. Or disable something at all and then just re-do it completely differently. You may need to repeat this exercise a few times.

This includes but not limited to, changing timer-based code to use tick-count, or a single timer to be broken into many small timers (more timers doesn't mean more lag, get this over your mind). Maybe looking for code such as mysql queries etc...
  Reply


Forum Jump: