Iterating through stuff in a box in a less brute force way
So I have this box, and I want to mess around with the speed of everything inside of it, including particles, actors and items, and there's the classical issue of it getting laggy when there's a lot of objects in the game, because it's still necessary to iterate through all of them to check if they are inside of the box or not.
A solution to this is to keep a table with all the items inside the box and just iterate through that, updating it every once in a while or when certain condition is met. What other solutions could be used for this? The ideal would be a way to check the objects inside the box every frame, but I could also change the physics of what's going on to adjust to checking the objects every other frame instead, which I've tried without success.
Any help is appreciated as always