HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How slow is game-cache?

12-20-2006, 06:21 PM#1
zergleb
In comparison with Dynamic arrays or other options how slow is gamecache? and maybe a better question how do I test this myself???? because I've seen people say things like oh yeah this is 7% faster than this other method, but how do they even test it?
12-20-2006, 06:32 PM#2
grim001
Here's the idea:
Gamecache will not slow down the game noticably if you are only using it in a non-repeating manner (unless you are dealing with some ridiculously huge amount of info, in which case it might freeze the game for a sec). Gamecache is also fine if you are accessing it perhaps 50 or 100 times a second through repeating timers. However, if you have a spell that winds up accessing gamecache 300 times a second (10 stored variables x 30 times a second...) and you have several players all using spells like that at the same time, it will cause a lot of lag.

Basically if you have a large-scale project where many repeating timers will be accessing gamecache hundreds of times a second, you need to use tables (which are still gc but faster) or even better, dynamic arrays, whenever possible. You may think you can get away with only using handle vars or something at first, but as the map gets larger, you will start seeing the cumulative effects of the lag. Better to start using faster solutions from the start so that you never run into that problem.
12-20-2006, 07:01 PM#3
Vexorian
Quote:
Gamecache is also fine if you are accessing it perhaps 50 or 100 times a second through repeating timers

I wouldn't go as far as 100.

...
It is not really true that gamecache is slow. It is most likelly gamecache could be a lot faster.

In the case of handle variables, just trash them. Because of all the things added to gamecache they become twice as slow as gamecache itself.

Then there are the tables which still have function calls and are still slower than gamecache.

Then you have gamecache + return bug usage, which might be faster than the above but it is still pretty lacking. Return bug itself requires another function call besides of all the troubles it will eventually cause you.
12-20-2006, 07:12 PM#4
Captain Griffen
~5 times slower than array lookups, I think.