400 units is too much for wc3 to handle. Also if you have a trigger that creates 400 units, that will really lag due to it is too many for Warcraft to handle. I suggest just make the enemies wave by wave and not 400 units all the way. Example 25-50 units maybe eadch wave and make intervals in the wave spawns because making waves spawn all the time makes wc3 lag also.
Total bullshit. I got over 900 units in my map, all pre-placed. My map size is 480x256. No lagging at all.
It's leaks that's causing this or a high poly count of custom imported models.
Try to disable all triggers in your map. Is you map still lagging?
If not, search for leaks!
If yes, try to put this into your map and see if it gets better:
http://www.hiveworkshop.com/forums/jass-resources-412/system-destructablehider-219569/
Now, to your questions:
another question as you can see i used destroygroup twice above, i guess i used to do it just to "feel safe" about the leak being fixed, but i also remember someone saying that we shouldnt put leak removals in loops, is that right? what problem would it cause?
Don't ever do that! Only destroy a group that actually exists or the thread/trigger will crash and not be able to run until the end!
Also, you destroy the group after each single enum process. Which means only the first enumed unit is affected, all others will simply be ignored, as the whole thread crashes after the first unit. Simply delete the group destruction inside the enumeration loop and it should work. Also, instead of using the custom unit value, use a
http://www.hiveworkshop.com/forums/jass-resources-412/system-unit-indexer-172090/
In the second trigger you posted, instead of using "Dying Unit", use "Triggering Unit", or the trigger will bug as soon as more than one unit dies within 20 seconds.