Snippet ForLoopHelper

Discussion in 'Systems and Snippets' started by Captain Grif, Jun 2, 2011.

  1. Dirac

    Dirac 22710180

    Ratings:
    +147 / 0 / -0
    Why is this still approved?
     
  2. emjlr3

    emjlr3 Change can be a good thing Staff Member

    Ratings:
    +396 / 0 / -0
    how do you explain my results here?

    specifically here?

     
  3. Bribe

    Bribe vJass errors are legion

    Ratings:
    +67 / 0 / -0
    I don't know how Nes came to the idea that JASS linked lists are slower than linear
    stacks, but his tests did not prove that.

    JASS:
    local integer i = stack.top -1
    local thistype this
    loop
        exitwhen i < 0
        set this = stack[i]
        //
        set i = i - 1
    endloop


    JASS:
    local thistype this = head.next
    loop
        exitwhen this == 0
        //
        set this = this.next
    endloop


    He didn't prove that the linked list (2nd example) is slower than the linear
    stack (1st example). In normal programming, yeah it's possible the first one
    is faster, but this is interpreted programming, JASS programming, notoriously
    slow. Your benchmarks that showed an FPS increase when switching to linked
    list should be fairly accurate.
     
  4. Nestharus

    Nestharus o-o

    Ratings:
    +83 / 0 / -0
    Bribe, I ask you again...

    what on earth does your post have to do with this submission.


    This submission would be example one, but slower.
     
  5. Bribe

    Bribe vJass errors are legion

    Ratings:
    +67 / 0 / -0
    I was replying to emjlr3 who made that comparison, because he brought up the
    point that you and I discussed on THW about Timer32-esque linked list versus a
    linear-stack-loop.
     

Share This Page