Original Post
I'm architecturing a 3D game engine with a couple of components (Graphics, physics, sound etc) where each of those wants to iterate the objects in the world. Currently each component will iterate the list of objects them self. Would I benefit from doing like this: Pseudocode:
For each object
doPhysics(ptr)
doRender(ptr)
doSound(ptr)
loop
Will the overhead from calling those functions be larger than the overhead with the multiple iterations (one for each component)? I don't have to worry about that the rendering and physics wanting different objects, I have a clever scene manager that fixes that =)