Boost отключать поленились, просто поставили типовой множитель(34) и запустили 32-разрядный брутер(passwordspro). Сам тест
Код
function fn1 takes nothing returns nothing local integer lA = 0 //prepare vars and game objects call TriggerSleepAction(0.01)//cleare CPU cache. It caches about 5 jass lines set lA = GetAllyColorFilterState() //test code set lA = GetAllyColorFilterState()-lA return lA endfunction function Trig_Actions takes nothing returns nothing local integer lA local integer i set lA = 0 set i = 0 call fn1()//memalloc, fileload penalties call TriggerSleepAction(0.01) loop exitwhen i == 100 set lA = lA + fn1() call TriggerSleepAction(0.01) set i = i + 1 endloop call DisplayTextToPlayer(Player(0),0,0,"1: "+I2S(lA/100-2000)) endfunction
Код
local integer lA = 0 local integer array ar local real rA local unit uA local boolean blna // 0 set lA = lA 1 000 set lA = 0 700 set rA = 1 1 000 set lA = ar[1] 1 100 set ar[1] = 1 7 500 set lA = argfn 1 700 set uA = null 1 000 set lA= -lA 4 500 set blna = true 1 300 set blna = not true 1 400 set lA = 1-2 1 400 set lAz = 1+2 1 300 set lAz = 5*8 1 500 set blna = not blna 1 100 set blna = blna 1 000 set lA = 2/3 1 500 set rA = 1.0+1.0 1 500 set rA = 1.1*8.8 1 800 set rA = 2.0/3.0 2 100 set blna = 1<2 2 600 set blna 1<=2 2 400 set blna 1==2 2 000 set lA = globlA 2 000 set globlA = lA loop 2 000 endloop 1 600 exitwhen true 3 300 if true then endif 2 800 if false then else endif 2 800 if not false then endif 2 900 call fna() 9 200 call fna(1) 13 000 call fna(1,1) 14 700 call fn()return 8 500 call fn()return 1 9 400 set lBz = fn()return 1 10 400 local integer lAz 2 700 local integer array ara 3 000
Выводы: Не допускать унарного минуса. Использовать >=, <= вместо >, <. Ставить return перед endfunction.
Код
set uA = CreateUnit(p, 'hsor', 512.0, 0, 270.0) 990 000 set uA = CreateUnitByName(p, "wisp", 512.0, 0, 270.0) 850 000 set uA = CreateUnitAtLoc(p, 'hsor', pa, 270.0) 1070 000 set uA = CreateUnitAtLocByName(p, "wisp", pa, 270.0) 930 000 set uA = CreateCorpse(p, 'hsor', 512.0, 0, 270.0) 140 000 call KillUnit(uA) 191 000 call RemoveUnit(uA) 88 000 call ShowUnit(uA,true)true 8 200 call ShowUnit(uA,false) true 18 300 call ShowUnit(uA,true) false 65 700 call ShowUnit(uA,false) false 1 700 call SetUnitState(uA,UNIT_STATE_LIFE,rA) 11 700 call SetUnitState(uA,UNIT_STATE_MAX_LIFE,rA) 8 900 call SetUnitX(uA,rA) 11 000 call SetUnitPositionLoc(uA,pAz) 127 000 call SetUnitFacing(uA,rA) 6 500 call SetUnitFacingTimed(uA,rA,0.5) 30 000 call SetUnitMoveSpeed(uA,rA) 14 400 call SetUnitFlyHeight(uA,rA,1.0) 14 400 call SetUnitTurnSpeed(uA,rA) 6 600 call SetUnitPropWindow(uA,1.1) 6 200 call SetUnitAcquireRange(uA,500.0) 6 100 call SetUnitCreepGuard(uA,true) 5 300 set rA = GetUnitAcquireRange(uA) 6 000 set rA = GetUnitTurnSpeed(uA) 5 600 set rA = GetUnitPropWindow(uA) 5 600 set rA = GetUnitFlyHeight(uA) 5 000 set rA = GetUnitDefaultAcquireRange(uA) 5 600 set rA = GetUnitDefaultTurnSpeed(uA) 5 600 set rA = GetUnitDefaultPropWindow(uA) 5 500 set rA = GetUnitDefaultFlyHeight(uA) 5 400 call SetUnitOwner(uA,p,true) 240 000 call SetUnitColor(uA,PLAYER_COLOR_RED) 12 000 call SetUnitColor(uA,null) 8 700 call SetUnitScale(uA,90.0,90.0,90.0) 5 300 call SetUnitTimeScale(uA,1.0) 5 400 call SetUnitBlendTime(uA,1.0) 7 200 call SetUnitVertexColor(uA,222,222,222,222) 11 600 call QueueUnitAnimation(uA,"walk") 25 000 call SetUnitAnimation(uA,"walk") 27 000 call SetUnitAnimationByIndex(uA,3) 11 600 call SetUnitAnimationWithRarity(uA,"walk",RARITY_RARE) 32 000 call AddUnitAnimationProperties(uA,"uap",true) 25 000 call AddUnitAnimationProperties(uA,"uap",false) 45 000 call SetUnitLookAt(uA,"chest",1.1,2.2,1.1) 36 000 call ResetUnitLookAt(uA) 25 000 call SetUnitRescuable(uA,p,true) 94 000 call SetUnitRescueRange(uA,200.0) 14 400 call SetHeroStr(uA,20,true) 72 000 call SetHeroAgi(uA,20,true) 64 000 call SetHeroInt(uA,20,true) 65 000 set lA = GetHeroStr(uA,true) 13 000 set lA = GetHeroAgi(uA,true) 13 100 set lA = GetHeroInt(uA,true) 13 400 call UnitStripHeroLevel(uA,1) 260 000 set lA = GetHeroXP(uA) 12 200 call SetHeroXP(uA,500.0,true) 780 000 set lA = GetHeroSkillPoints(uA) 13 000 call UnitModifySkillPoints(uA,4) 46 000 call AddHeroXP(uA,100,true) 66 000 call SetHeroLevel(uA,4,true) 790 000 call SetHeroLevel(uA,4,false) 240 000 set lA = GetHeroLevel(uA) 12 200 set lA = GetUnitLevel(uA) 22 000 set sAz = GetHeroProperName(uA) 77 000 call SuspendHeroXP(uA,true)false 12 300 set blnA = IsSuspendedXP(uA) 13 700 call SelectHeroSkill(uA,'AHab') 650 000 set lA = GetUnitAbilityLevel(uA,'Rhst')0 6 900 call DecUnitAbilityLevel(uA,'Rhst')2 21 000 call IncUnitAbilityLevel(uA,'Rhst')0 6 400 call SetUnitAbilityLevel(uA,'Rhst',1)0 7 400 call ReviveHero(uA,1.1,1.1,true) 1470 000 call ReviveHero(uA,1.1,1.1,false) 610 000 call ReviveHeroLoc(uA,pAz,true) 1470 000 call SetUnitExploded(uA,true)false 5 600 call SetUnitInvulnerable(uA,true) 33 000 call PauseUnit(uA,true) 122 000 set blnA = IsUnitPaused(uA)false 4 900 call SetUnitPathing(uA,false)true 7 000 call ClearSelection()1 35 000 call SelectUnit(uA,true) 174 000 set lA = GetUnitPointValue(uA) 6 100 set lA = GetUnitPointValueByType('hsor') 4 300 set blnA = UnitAddItem(uA,iAz) 142 000 set iAz = UnitAddItemById(uA,'ratc') 400 000 set blnA = UnitAddItemToSlotById(uA,'ratc',1) 910 000 call UnitRemoveItem(uA,iAz) 110 000 set iAz = UnitRemoveItemFromSlot(uA,1) 128 000 set blnA = UnitHasItem(uA,iAz) 37 000 set iAz = UnitItemInSlot(uA,1) 41 000 set lA = UnitInventorySize(uA) 10 200 set blnA = UnitDropItemPoint(uA,iAz,512.0,50.0) 240 000 set blnA = UnitDropItemSlot(uA,iAz,2) 142 000 set blnA = UnitDropItemTarget(uA,iAz,uBz) 265 000 set blnA = UnitUseItem(uA,iAz)pdiv 710 000 set blnA = UnitUseItemPoint(uA,iAz,512.0,100.0) whwd 250 000 set blnA = UnitUseItemTarget(uA,iAz,uBz) wcyc 1310 000 set rA = GetUnitX(uA) 6 100 set rA = GetUnitY(uA) 6 200 set pAz = GetUnitLoc(uA) 13 900 set rA = GetUnitFacing(uA) 5 900 set rA = GetUnitMoveSpeed(uA) 11 200 set rA = GetUnitDefaultMoveSpeed(uA) 5 400 set rA = GetUnitState(uA,UNIT_STATE_LIFE) 9 100 set rA = GetUnitState(uA,UNIT_STATE_MAX_LIFE) 8 800 set rA = GetUnitState(uA,UNIT_STATE_MANA) 8 900 set rA = GetUnitState(uA,UNIT_STATE_MAX_MANA) 8 700 set p = GetOwningPlayer(uA) 6 200 set lA = GetUnitTypeId(uA) 4 900 call GetUnitRace(uA) 4 500 set sAz = GetUnitName(uA) 12 000 set lA = GetUnitFoodUsed(uA) 5 600 set lA = GetUnitFoodMade(uA) 5 200 set lA = GetFoodMade('hsor') 4 400 set lA = GetFoodUsed('hsor') 3 600 call SetUnitUseFood(uA,false)true 9 700 set pa = GetUnitRallyPoint(uA) 20 000 set uBz = GetUnitRallyUnit(uA)null 24 000 set dAz = GetUnitRallyDestructable(uA)null 23 000 set blnA = IsUnitInGroup(uA,gAz)false 18 700 set blnA = IsUnitInGroup(uA,gAz)true 19 200 set blnA = IsUnitInForce(uA,forcez)true 19 400 set blnA = IsUnitOwnedByPlayer(uA,p)true 19 100 set blnA = IsUnitAlly(uA,p)true 18 500 set blnA = IsUnitEnemy(uA,p)true 18 800 set blnA = IsUnitVisible(uA,p)false 21 000 set blnA = IsUnitDetected(uA,p)true 18 400 set blnA = IsUnitInvisible(uA,p)false 21 000 set blnA = IsUnitFogged(uA,p)true 22 000 set blnA = IsUnitMasked(uA,p)fals 22 000 set blnA = IsUnitSelected(uA,p)false 19 000 set blnA = IsUnitRace(uA,RACE_HUMAN)hsor 18 500 set blnA = IsUnitType(uA,UNIT_TYPE_HERO)hsor 17 500 set blnA = IsUnitType(uA,UNIT_TYPE_DEAD)hsor 16 700 set blnA = IsUnitType(uA,UNIT_TYPE_STRUCTURE)hsor 16 800 set blnA = IsUnitType(uA,UNIT_TYPE_FLYING)hsor 16 500 set blnA = IsUnitType(uA,UNIT_TYPE_GROUND)hsor 16 800 set blnA = IsUnitType(uA,UNIT_TYPE_ATTACKS_FLYING)hsor 19 100 set blnA = IsUnitType(uA,UNIT_TYPE_ATTACKS_GROUND)hsor 18 600 set blnA = IsUnitType(uA,UNIT_TYPE_MELEE_ATTACKER)hsor 19 200 set blnA = IsUnitType(uA,UNIT_TYPE_RANGED_ATTACKER)hsor 19 000 set blnA = IsUnitType(uA,UNIT_TYPE_GIANT)hsor 18 100 set blnA = IsUnitType(uA,UNIT_TYPE_SUMMONED)hsor 19 100 set blnA = IsUnitType(uA,UNIT_TYPE_STUNNED)hsor 23 000 set blnA = IsUnitType(uA,UNIT_TYPE_PLAGUED)hsor 24 000 set blnA = IsUnitType(uA,UNIT_TYPE_SNARED)hsor 24 000 set blnA = IsUnitType(uA,UNIT_TYPE_UNDEAD)hsor 17 900 set blnA = IsUnitType(uA,UNIT_TYPE_MECHANICAL)hsor 17 500 set blnA = IsUnitType(uA,UNIT_TYPE_PEON)hsor 18 100 set blnA = IsUnitType(uA,UNIT_TYPE_SAPPER)hsor 17 200 set blnA = IsUnitType(uA,UNIT_TYPE_TOWNHALL)hsor 18 100 set blnA = IsUnitType(uA,UNIT_TYPE_ANCIENT)hsor 19 100 set blnA = IsUnitType(uA,UNIT_TYPE_TAUREN)hsor 18 400 set blnA = IsUnitType(uA,UNIT_TYPE_POISONED)hsor 24 000 set blnA = IsUnitType(uA,UNIT_TYPE_POLYMORPHED)hsor 25 000 set blnA = IsUnitType(uA,UNIT_TYPE_SLEEPING)hsor 24 000 set blnA = IsUnitType(uA,UNIT_TYPE_RESISTANT)hsor 23 000 set blnA = IsUnitType(uA,UNIT_TYPE_ETHEREAL)hsor 17 600 set blnA = IsUnitType(uA,UNIT_TYPE_MAGIC_IMMUNE)hsor 19 000 set blnA = IsUnit(uA,uBz)false 6 900 set blnA = IsUnitInRange(uA,uBz,22.2)false 9 700 set blnA = IsUnitInRangeXY(uA,111.1,111.1,22.2)false 8 900 set blnA = IsUnitInRangeLoc(uA,pa,22.2)false 10 600 set blnA = IsUnitHidden(uA)false 6 300 set blnA = IsUnitIllusion(uA)false 5 100 set blnA = IsUnitInTransport(uA,uBz)false 27 000 set blnA = IsUnitLoaded(uA)false 15 200 set blnA = IsHeroUnitId('hsor') 11 400 set blnA = IsHeroUnitId('Hamg') 12 200 set blnA = IsUnitIdType('hsor',UNIT_TYPE_UNDEAD) 18 200 call UnitShareVision(uA,p,true) 35 000 call UnitSuspendDecay(uA,true) 13 700 set blnA = UnitAddType(uA,UNIT_TYPE_TAUREN) 18 400 set blnA = UnitRemoveType(uA,UNIT_TYPE_TAUREN) 17 500 Дальше лень
зы где-нибудь еще выкладывали подобные результаты?
Сообщение отредактировал IIAXAH - Суббота, 18 Мая 2013, 21:30:48
IIAXAH, что так грубо? Наверно меня заинтересовало..
Добавлено (19 Мая 2013, 00:07:00) --------------------------------------------- Постой, такой вопрос: Можно ли сделать такой бенч к примеру ниже?
Код
function trg_test_02 takes nothing returns nothing local timer t = GetExpiredTimer() local real sc if udg_stop then call DestroyTimer(t) set sc = (I2R(udg_tc)/1000)//-udg_pg call DisplayTextToPlayer(Player(0),0.,0.,R2S(sc)) else udg_tc = udg_tc +1 endif set t = null endfunction
function trg_test_01 takes nothing returns nothing local i = 0 loop exitwhen i == 1000 i = i + 1 call GetTriggeringTrigger() endloop set udg_stop = true endfunction
function trg_test takes nothing returns nothing local timer t = CreateTimer() set udg_tc = 0 set udg_stop = false call TimerStart(t,.001,true,function trg_test_02) call trg_test_01() set t = null endfunction
Фигня наверное... ---------- Жду только ответа, только от Alice. Никаких чужих ответов, типа некоторых врывных ответов, от некоторых пехотинцев...
Сообщение отредактировал Волчачка - Воскресенье, 19 Мая 2013, 00:09:33