SA-MP Forums Archive
Doubt about PVar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Doubt about PVar (/showthread.php?tid=539052)



Doubt about PVar - Paramount. - 26.09.2014

It's true that pvar spends more memory than common var?

Sorry my bad english, i'm not from USA.


Re: Doubt about PVar - Crayder - 26.09.2014

https://sampwiki.blast.hk/wiki/Per-player_variable_system <- Read This

I think they use less memory, "Saves memory by not allocating pawn array elements for playerids which will probably never be used."


Re: Doubt about PVar - Paramount. - 26.09.2014

Thanks!! +rep


Re: Doubt about PVar - TakeiT - 26.09.2014

They do use more memory, as it has to save it to the server instead of the script, or something like that. It's not 1992, 1mb of ram isn't going to make or break anything, I don't know what people have against PVars, though I prefer to just use variables.


Re: Doubt about PVar - Abagail - 26.09.2014

In my experience the use of limited player variables(pvar's) isn't performance decreasing, how-ever they are not meant for practical use. They are mostly used to communicate between gamemode, filterscripts, etc.


Re: Doubt about PVar - Crayder - 27.09.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
In my experience the use of limited player variables(pvar's) isn't performance decreasing, how-ever they are not meant for practical use. They are mostly used to communicate between gamemode, filterscripts, etc.
Yeah, that's all they are good for... I wouldn't use them over regular variables... But that's not what he was asking...


Re: Doubt about PVar - Vince - 27.09.2014

The main cause of concern is that they are a whole lot SLOWER than regular variables. Since present day servers have more than enough memory, I'd be more than willing to trade some for improved speed. In short, don't use PVars unless you need them across scripts.