[JASS] Which is faster?

Status
Not open for further replies.
Level 2
Joined
Nov 29, 2021
Messages
8
I'm currently writing a dummy system and I want it to have a sanity check, which of the options is faster and what happens with LoadBoolean() if the hashtable is empty at that spot?

Edit: How would HaveSavedBoolean() compare to those two?
 

Attachments

  • What is faster.PNG
    What is faster.PNG
    5.7 KB · Views: 55
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Hashtable lookups are assumedly faster. IsUnitInGroup() has to enumerate over the entire Unit Group until it finds the desired unit and I imagine there's more to it than just that which would make it slower.

Go with either LoadBoolean() or HaveSavedBoolean(). I can't say which of these 2 is faster but it's probably such a small difference that you couldn't possibly tell the difference in-game.
 
Status
Not open for further replies.
Top