Posts: 94
Threads: 0
Joined: Jan 2011
Reputation:
0
Mistake me if I'm wrong but wasn't there a test showing that Enums where microseconds faster than pvars?
Posts: 2,896
Threads: 11
Joined: Sep 2008
Reputation:
0
Just go with the PVars, having global variables will use unnecessary memory.
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
The fastest - is less cpu usage, use global arrays for less cpu usage.
Posts: 6,129
Threads: 36
Joined: Jan 2009
PVars are slower than normal variables/arrays, but consume more memory depending on the operation, seeing as PVars do not allow you to allocate a static amount of memory.
Seeing as how 1 cell / a variable with only 1 cell consumes only 4 bytes of memory, I'd say that you're fine with either option, especially as PVars aren't that much slower.
PVars are also a lot more convenient as they reset when a player connects, but I personally use arrays/normal variables.
Posts: 1,130
Threads: 77
Joined: Jan 2010
Reputation:
0
Fastest = less CPU ussage, so your thread is like misspointing.
I use a combination of both. When checking for admin levels, i use PVars since i can use it on different scripts. But mainly global arrays.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by [L3th4l]
I use a combination of both. When checking for admin levels, i use PVars since i can use it on different scripts. But mainly global arrays.
|
I use a combination of both too, however I use PVars for things certain players won't require for checking, i.e: Use of a command restricted to a certain team, and seeing as how PVar integers return 0 if not set, they are extremely convenient.
Posts: 613
Threads: 11
Joined: Aug 2010
Reputation:
0
There was a test already about that posted somewhere. PVars ended up being ~3 times slower than normal variables.