Making an object renderer for dynamic objects even faster?

Originally I was making a knockback function but realized that it can be pretty laggy if the physics was handled by the server, so I added some interpolation for visual models on the client to the root being updated on the server. This is pretty laggy once the number of objects scales, so I ended up writing a renderer for them.

Right now it determines whether or not to update the NPC based on if it’s in the screen with some margin to screen point depth scale. I added a simple positional check of the xz components to see if it fits in a box with a predetermined length (used for width too) and this cut down the time by 60%. Right now, I got 0.002 seconds every frame with 400 NPCs, but was wondering if there were any other ways I could be able to cut down the search list? Right now it’s just iterating through all the objects and seeing if there’s anything that should be updated.

I didn’t use octrees or any partitioning since I believe those work best with static objects, but I’m dealing with objects that move around. I did like the idea of octrees for static objects in case I wanted to animate trees or NPCs that don’t move though.

Here’s what I got so far:

Any help would be appreciated!