Speed of GameCache vs Global Lists

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Well, the title says it all =p.

I've done some searching on this topic, but did not find anything, and I was wondering if anyone had done some speed tests on these two meathods.

Ank'e much,
Korolen
 

wonderpriest

New Member
Reaction score
18
I am positive that Globals would be faster. I think. :p

I shall do some testing, though it's logical that Globals are faster, but I have seen wackier things happen with WC3's engine...
 

wonderpriest

New Member
Reaction score
18
Okay. I did a bit of testing, and as I expected Globals are much faster that using the Game cache. Actually, about 7 times faster :eek:

The game cache is a great resource to use, but don't try to replace Globals with it, or depending on the trigger actions, you will notice the difference. So, first try to use locals, then globals, then the cache :)
 

SFilip

Gone but not forgotten
Reaction score
634
gamecache isn't so slow...but you should use globals if you can.
why are you asking this btw? plain curiosity or are you trying to do something?
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
I just want to optimise a 33 times per second trigger (for sliding), which currently uses all gamecache.
wonderpriest said:
Okay. I did a bit of testing, and as I expected Globals are much faster that using the Game cache. Actually, about 7 times faster :eek:
Thanks alot for the testing, I should be able to make my triggers much faster. (By the way, how did you get your results?)
 

SFilip

Gone but not forgotten
Reaction score
634
if you're using CSCache or kattana's vars in it then there probably isn't a way to use globals. besides if your trigger works correctly then there is nothing to worry about...
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
SFilip said:
if you're using CSCache or kattana's vars in it then there probably isn't a way to use globals. besides if your trigger works correctly then there is nothing to worry about...
Well, it works, I just want it to be as fast as possible, and it should be easy to convert to globals.
 

wonderpriest

New Member
Reaction score
18
Korolen said:
I just want to optimise a 33 times per second trigger (for sliding), which currently uses all gamecache.Thanks alot for the testing, I should be able to make my triggers much faster. (By the way, how did you get your results?)
Ooops. I meant 4 times faster, I use the numpad and pressed the wrong key. It's actually a bit less than 4, but I rounded up, and I admit, I didn't do alot of testing. Used a loop with some random actions inside, that were exactly the same for both. After thinking about it, I believe that retrieving a value from the cache is not that much slower than retrieving a value from a variable. It's just that it takes extra time to access, set equal to itself plus one, because you have to save a value that you just retrieved.

Wow, I just made that more complicated than it need to be...

To make it simple:
Using game cache is only slower because you have to access and manipulate it more, which adds more and more time.

Use Globals when you can, after locals, and before the game cache.
 

SFilip

Gone but not forgotten
Reaction score
634
Korolen said:
Well, it works, I just want it to be as fast as possible, and it should be easy to convert to globals.
well unless its working slow then you really shouldn't. besides its not even possible if you are using H2I (the bug used in kattana's vars and CSCache) - that function is slower than storing in either gamecache or globals so it makes no difference really.
 
C

Capt Griffen

Guest
SFilip said:
well unless its working slow then you really shouldn't. besides its not even possible if you are using H2I (the bug used in kattana's vars and CSCache) - that function is slower than storing in either gamecache or globals so it makes no difference really.

H2I isn't that slow. Game cache is, and can be avoided, such as with a parallel array system.
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
Well, in the map that I'm currently developing, each player only controls one unit, so I don't need H2I to do a global array, or to use GameCache (but the whole advantage of GameCache is that you CAN use H2I easily).

And, as for optimising the function, It may not make my computer run slowly, but I know for a fact (my brother's computer in mind) that there are some people who play Warcraft on slooooow computers, and I want it to run wiht the best framerate as possible.

And wonderpriest, how did you do your speed tests? I can't figure out a way to acuratly record time, and when I do anything that takes some time (like running tests in a loop), then the trigger is cut short.
 

SFilip

Gone but not forgotten
Reaction score
634
Capt Griffen said:
H2I isn't that slow. Game cache is, and can be avoided, such as with a parallel array system.
then why CSCache uses the gamecache? if globals are faster then i see no point in that...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top