Originally Posted by Rising_Dusk
Well, UIU/AI inlining their GetUnitId call makes it as fast as a single native. PUI's GetUnitIndex calls a few natives, performs several array lookups, performs several array sets, and checks at least a few if/then comparisons before returning the value. The difference is monumental, although in practical applications it may not matter. (Depends upon the frequency of your calling it, really)
Yes, I noticed that "GetUnitIndex" is bloated compared to "GetUnitId" function. What I am still wondering about is the recycling and detection aspect of these systems. Is PUI more efficient regarding these other aspects? If so, does it make up for the performance loss described above?
I use PUI extensively and call it a lot. In fact, anytime a tower attacks or a unit is damaged (notice these are not the same) PUI gets called. If the performance difference is actually noticeable and significant (as opposed to some theoretical nanosecond stuff I don't care about) then I have a problem. However, I'd like to know about recycling and detection before changing to another system.