HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Benchmark request

09-24-2007, 11:07 PM#1
Vexorian
somebody try TriggerEvaluate(TriggerWithDoNothingAsCondition) vs. ForForce(forceWithOnePlayer, function DoNothing
09-25-2007, 09:14 AM#2
Toadcop
just tested
Collapse JASS:
globals
   integer array intxx
   integer intx=0
   timer tt=CreateTimer()
   trigger xxt=CreateTrigger()
   force fx=CreateForce()
endglobals

function XXXXZ takes nothing returns boolean
   return false
endfunction

function INITTRG takes nothing returns nothing
    call TriggerAddCondition(xxt,Condition(function XXXXZ))
    call ForceAddPlayer(fx,Player(0))
endfunction

function test takes nothing returns nothing
    local integer i=1
    local integer tmr=0
     set intxx[2]=1
    set tmr=StopWatchCreate()
  loop
    exitwhen i>1000
      //call TriggerEvaluate(xxt)
      call ForForce(fx, function DoNothing)
    set i=i+1
  endloop
    call echo(R2S(StopWatchMark(tmr)*1000))
    call StopWatchDestroy(tmr)
endfunction

//===========================================================================
function InitTrig_aaa takes nothing returns nothing
    set gg_trg_aaa = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_aaa, Player(0) )
    call TriggerAddAction( gg_trg_aaa, function test)
call INITTRG()
endfunction

Evaluate ~12.3
ForForce ~13.1

evaluate is bit faster so no evo xD
09-25-2007, 01:09 PM#3
Vexorian
well, that's blizz for you, I guess they spend some time initializing some structure before calling the function
09-25-2007, 04:08 PM#4
Toadcop
btw in this way of the story =) i remember what ForGroup() with alot of units will call funcs faster than simple to do actions with inlined actions in loop (units are in a array). =) but i also remember what first ForGroup() intialization IS VERY slow =\. what i mean so to do actions for 100 units will be faster than using ForGroup() =)