1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] OMG help!

Discussion in 'Triggers & Scripts' started by Flame_Phoenix, Jun 13, 2008.

  1. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    Ciebron,constants are faster, and can not be changed in code. This way the code is more efficient and is safer as well.
     
  2. Ciebron

    Ciebron

    Joined:
    Apr 6, 2008
    Messages:
    760
    Resources:
    2
    Spells:
    2
    Resources:
    2
    oh didnt know that :> ty
     
  3. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Constants are not faster.

    However, Vex's Optimizer inlines them (except, to my knowledge, some like Boolexprs which it would be stupid to inline)

    I'm not sure if it checks for non-constants that are never set except in their declaration, but I doubt it, since it would be stupid to.
     
  4. spiwn

    spiwn

    Joined:
    Apr 27, 2008
    Messages:
    1,228
    Resources:
    0
    Resources:
    0
    Again 100% correct.
    The optimizer started to inline constants when Vexorian introduced the JESP standart, so that when you implement a spell that is JESP and u optimize your map it is not slowed by calling the constant functions/variables.
     
  5. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    but Daelin says constant functions are faster !?
    The same principle does not apply to globals ?
     
  6. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    No, and constant functions are barely, if at all, faster anyways.

    But seeing as globals take the necessary one operation to read, I don't see how they could possibly be any faster.
     
  7. Captain Griffen

    Captain Griffen

    Joined:
    Nov 20, 2005
    Messages:
    1,001
    Resources:
    3
    Maps:
    3
    Resources:
    3
    Constant functions and globals compile to exactly the same byte code, or at least so sayeth the Lord, I believe, and thus it must be so.

    Constant functions are faster in the sense that Vex's optimizer inlines them, but vJASS is starting to auto-inline (or is that the optimizer?).
     
  8. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    I wouldn't be surprised if it becomes solely vJass doing all of the obfuscating and optimizing after a while, since there's no reason not to.
     
  9. Flame_Phoenix

    Flame_Phoenix

    Joined:
    May 4, 2007
    Messages:
    2,283
    Resources:
    11
    Tools:
    1
    Maps:
    1
    Spells:
    6
    Tutorials:
    3
    Resources:
    11
    So you guys are saying the Vexorian's map optimizer will just be ... discarded one day ?
     
  10. spiwn

    spiwn

    Joined:
    Apr 27, 2008
    Messages:
    1,228
    Resources:
    0
    Resources:
    0
    Well maybe it's features will be included in JNGP.
    So you just click the Vexorian Optimizer menu in the main window and blah ...