Script optimization is really important in MTA, and if you cannot avoid using events like onClientRender then special care should be taken for them (e.g many conditions, cancelling unnecesary execution early, and such). Always imagine that otherwise you're executing whatever is in it, between 60 and 100 times per second.
There's a bunch of most popular ways scripters on MTA mess up performance (and cause lag & crashes) for players on their servers, and that's one of them.
About avoiding render: imagine you do acceptable optimization when you use it, but then in the end.. multiple resources with 'acceptable optimization' still add up to a high total usage.
Anyways, for example, you could add / remove the render event when player comes close/leaves the proximity of a 'ped' in your case. Then you don't need to get all of those values or do the calculation between 60-100 times per second, all the time. And if the peds are static, then define a static location instead of getting their position constantly.. or if they aren't static but also not actively on the move, get (and store) it once.. instead of 60-100 times per second.
Edited @oggygod