g[s]et_cvar and g[s]et_pcvar
in general which is better to use?
i know that as of 1.80 g[s]et_pcvar has all the functions as g[s]et_cvar so this should not be a factor |
Re: g[s]et_cvar and g[s]et_pcvar
g[s]et_pcvar is a pointer for cvars and is much faster!
|
Re: g[s]et_cvar and g[s]et_pcvar
|
Re: g[s]et_cvar and g[s]et_pcvar
yes i know it is faster but for that speed you are sacrificing memory, or at least that is what ive read.
okay lets put it this way. i kno that if u use it for multiple functions then pcvar is the way to go but is it better than using cvar with 1 function? which example is better?: PHP Code:
PHP Code:
|
Re: g[s]et_cvar and g[s]et_pcvar
The first one.
|
Re: g[s]et_cvar and g[s]et_pcvar
if you really wanted to optimize it, you could just do:
Code:
public plugin_init() |
Re: g[s]et_cvar and g[s]et_pcvar
Quote:
memory usage to his pcvar example: identical performance: worst. you check everytime in client_putinserver if the cvar is registered which will cost performance(not much, but it costs performance). |
Re: g[s]et_cvar and g[s]et_pcvar
I've said this before and I'll say it again:
You should allways optimize for speed rather than memory consumption. |
Re: g[s]et_cvar and g[s]et_pcvar
does the speed much that much of a difference?
|
Re: g[s]et_cvar and g[s]et_pcvar
Quote:
|
All times are GMT -4. The time now is 10:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.