• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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,584
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