HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

loop trough unit group

04-29-2007, 07:11 PM#1
MaD[Lion]
i wonder which method is fastest (performance) to loop trough a unit group.
Is it to use the ForGroup() native or is it to use FirstInGroup method.
Anyone got any idea?
04-29-2007, 07:53 PM#2
grim001
ForGroup is faster if you must keep the unitgroup

FirstOfGroup is faster if you don't care about destroying the unitgroup
04-29-2007, 08:08 PM#3
iNfraNe
Quote:
Originally Posted by grim001
FirstOfGroup is faster if you don't care about destroying the unitgroup
Really? I always thought ForGroup was faster no matter what.
04-29-2007, 08:20 PM#4
PipeDream
1. Create a blank map
2. Write a function to test one loop
3. Write a function to run (2) 100-300 times with TriggerEvaluate
4. Write another function to run (3) 100-300 times with TriggerEvaluate
5. Write a trigger to run (4) at TriggerSleepAction(0.) after map start
6. Start warcraft, move mouse, count seconds on windows or wall clock until warcraft unfreezes
7. Go back to 2-6 but switch to the other loop, then compare the times and tell us what you find.
04-29-2007, 11:01 PM#5
MaD[Lion]
hm its ok, i have choosen to use forgroup, since i wanted to avoid loop :P