1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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 ...