HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

CSCache effectiveness

01-27-2006, 08:27 PM#1
qwertyui
I am now thinking about really using Vexorian's CSCache in my map, because its so much more flexible.
However, there is still a thing i want to know.
In what use cases is CSCache more effective than using normal and array variables, and in what instances i am better off sticking to old school stuff.
01-27-2006, 11:18 PM#2
Vexorian
I don't understand why people actually ask this question.

There is no case in where CSCache is more effective than 'normal ' variables/arrays.

There is no case in where 'normal ' variables/arrays are more effective than CSCache.

You see? An issue requires either of them, they do behave differently. normal variables/arrays are not dynamic , you have to declare them. And for example the size of arrays is fixed.

Instead things from CSCache are dynamic, you don't have to declare them when editing the script but you can just use / extend them during the game.

Things from CSCache are all global so there is no way to use them instead of local variables.

But of course, usage itself of CSCache things is very different there are attacheable variables that you can attach to handles and you can attach values of any type. These functions are 2D and have 2 arguments, a handle and a string.

Normal variables/array are just the same name always. They are faster but unflexible, if you use them you are forced to use the same instance of a variable everywhere.

Instead for tables or attacheable variables you can attach one to a trigger for example, that way you can have multiple instances very easily.

Tables are a very special branch, you can create new tables in game, use Attachment tables (which hold attachment variables) or use [tables] with fixed names. Trying to use them in moments where global variables are to be used it would be overkill and slower. Trying to use global variables to replace tables is impossible.

Tables take 2 string arguments.

Global variables have a fixed name, and in case they are arrays they are limited in size and require a integer
01-28-2006, 07:13 AM#3
qwertyui
So from what you are saying is that basically they serve different purposes and cannot be compared.

I understand that, but this still does not answer my question.

If i understand correctly, once gscache is implemented, there is no real reason to further use non-gscache variables, except for some occasional local. That means that gscache will effectively replace all global variables.

So what i am asking is - if i this happens, will gscache still be as fast as those variables? Or are there use cases where GSCache will end up slower?

Or maybe i am just completely missing the point?
01-28-2006, 11:03 AM#4
Anitarf
Quote:
Originally Posted by Vexorian
Normal variables/array are just the same name always. They are faster but unflexible, if you use them you are forced to use the same instance of a variable everywhere.
.
01-28-2006, 03:17 PM#5
qwertyui
Ah yes, sorry
Reading comprehension ftw :/

Thanks!