Posts: 1,046
Threads: 29
Joined: Mar 2010
Reduce using fast callbacks/timer functions. (As OnPlayerUpdate and some fast timers also.)
And reduce also using alot of arrays where you want to store player variables. Use Pvars instead.
Posts: 937
Threads: 69
Joined: Dec 2009
Reputation:
0
Well my OnPlayerUpdate is clear enough though. Well i'll take a look into some timers i have and will try to use pvars. Will let you know tho.
Posts: 1,498
Threads: 19
Joined: Jun 2009
Reputation:
0
12mb is average / low usage in terms of memory for a SA:MP server, I wouldn't worry too much about trying to get 1mb lower since most servers today have 2GB+ on them.
Edit: looks like this was already posted.
Posts: 937
Threads: 69
Joined: Dec 2009
Reputation:
0
Then I'll make a support ticket. Thanks you helped a lot.
Posts: 1,046
Threads: 29
Joined: Mar 2010
Quote:
Originally Posted by ******
Neither of those will help. If you're concerned about memory footprint, making code faster won't do anything to help. What's more PVars are both slower and less memory efficient than regular variables, so switching to them will make your code WORSE, not better.
Just to explain, a PVar needs the same amount of memory to store the data as the native varaible does, but it needs additional memory to store it's name and where it is in memory, which is why it's less efficient.
|
First of all PVars has its own register where you can store data but if you are using the "new" variables with/without those arrays it'll take some spaces from the RAM since the .amx will include more placeholders to store things in it.
It may be useless to use PVars if you need less placeholders but remember if you start to work with about 50000-200000 cells/placeholders (Typical for RP Servers which includes a huge amount of player variables) it won't be better with those 1D/2D variables and also takes the speed of compiling and running the script.