bigger gamemode more CPU?
#1

the bigger the game mode the more CPU it will use? if so how big would it have to be to use to much?
Reply
#2

Depending how much Timers you use.
Reply
#3

is 5 timers ok?
Reply
#4

The number of timers doesn't matter. A bigger gamemode would only use more RAM, not CPU (as pawn is single threaded).
Reply
#5

Quote:
Originally Posted by Sampiscool123
the bigger the game mode the more CPU it will use? if so how big would it have to be to use to much?
Quote:
Originally Posted by Sampiscool123
is 5 timers ok?
What are you actually trying to do? Screw up your server?
Reply
#6

Quote:
Originally Posted by Don Correlli
What are you actually trying to do? Screw up your server?
There's nothing wrong with having 5 timers... you could have 50 and there still wouldn't be any problems.
Reply
#7

Quote:
Originally Posted by RoBo
There's nothing wrong with having 5 timers...
I haven't said anything against timers. Check his first post and maybe you'll get the point.

Quote:
Originally Posted by RoBo
you could have 50 and there still wouldn't be any problems.
Indeed, if the interval is big enough.
Reply
#8

does more objects mean more CPU?
Reply
#9

CPU usage is caused by processing data, not by objects, timers etc.
Please read http://forum.sa-mp.com/index.php?topic=79810.0 for ways to lower CPU usage.
And be sure that your OnPlayerUpdate is very optimized because any code in there gets called hundreds of times a second.
Reply
#10

In short - each time you do something on your server it takes up some ticks from the cpu.
For example, an if statement, a for loop, writing to a file, etc, will use up CPU.

Generally in SA-MP most CPU usage is generated by players (commands, etc)
Example - lets say you have 100 commands that use the standard 'strcmp' method in your script, thats ~100 boolean expressions that the script may potentially need to cycle through each time you enter a command (depending on where the command is in the callback ofc).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)