Personally, if you know what type of entities you’re looking for, I’d say keep a list. ents.GetAll( ) may be faster, depending on how many entities are spawned. ents.FindInCone is REALLY expensive, the other finds are not as bad, but still expensive.
For example, if you want to get all players in a radius, instead of using FindInSphere, use player.GetAll( ) and check Distance; it’ll still give you a “sphere” effect, and it’ll be cheaper.
If you want vehicles; instead of FindByClass; every time a vehicle is spawned add it to a list, when it is removed, remove it from the list; then you’ll have a small list to look through instead of all of them.
It depends on each context; run the benchmark and see.
Lua code was messing up and showing partial html tags, here:
Remove the .html to get the lua file.
EDIT: Odd, I could’ve sworn I hit edit… Whoops…