• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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: 49
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
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