View Single Post
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-01-2020 , 14:43   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #15

Quote:
Originally Posted by MAGNAT2645 View Post
But StringMap doesn't have a method named FindString.
StringMap API
Oops meant to be .GetValue.

Quote:
Originally Posted by MAGNAT2645 View Post
When input and output buffers aren't the same.
Oops, thanks.

Quote:
Originally Posted by MAGNAT2645 View Post
I heard that GetConVar* natives cache their values so you don't need to use variables to store each value. (BUT i'm not sure 100%)
Checked C++ source for these natives and found nothing about caching.
I read this too somewhere but does not seem to be the case. Benchmarking shows what I suggested is quicker. It might still be fast without hooking ConVar change etc, but if you have hundreds of cvars, hundreds of plugins and using them in Think hooks or OnGameFrame etc it'll add up and to squeeze out some extra CPU cycles can't harm. It's not very difficult to setup the whole thing.
__________________

Last edited by Silvers; 02-01-2020 at 14:44.
Silvers is offline