ents.FindInSphere vs ents.GetAll over a distance.

I’m making something that get’s the ents on a server and with in a certain distance give them an ESP like look.

Just wanting to know if it’s better to get the ents.FindInSphere

or to get all ents and check their distance to the player?

That is basically what the ents.FindInSphere does. It loops through all of the entities and checks the distance. If you want to add other checks as if the entity has certain classes and else, you should then loop through ents.GetAll and do both checks (the distance and the other one) yourself, but if not then there’s no need to.
Also, have in mind that if there is a high number of entities it may get a bit slow.

I think ents.FindInSphere should be faster because it takes spatial partitioning into account

Okay thank you.