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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top