Squiggy, it is much better to keep count of how many units of a certain type are alive than do that. Groups are extreemly demanding to create all the time and are meant to be used eithor to find a group of units once (eg units in an area when a spell is used).
If you really must use a group, cache the group (keep it in a global) and run your test. That way it will still reference the same units but it will not rebuild it from scratch each time. Keeping count of unit number alive is still the more efficent way (in an integer, not using the crappy count units in group).