In this specific example, reducing indirection, using arrays instead of vectors I think. It might be a bit overkill for this example but, say that you want to implement a sprite renderer, limiting that to 1k entities might enable lots of surface for optimization without adding any complexity. On the other hand, building something generic, like a sprite renderer that can render both 1k and 1m entities optimally might require way complex structures and logic.
I'd love if you could make some posts covering GPGPU and Graphics programming, similar to the "Onboarding floating-point" series.
What's the reason(s) for adding constraints? As I understood it it's for performance and reducing the chance of bugs, is that correct?
In this specific example, reducing indirection, using arrays instead of vectors I think. It might be a bit overkill for this example but, say that you want to implement a sprite renderer, limiting that to 1k entities might enable lots of surface for optimization without adding any complexity. On the other hand, building something generic, like a sprite renderer that can render both 1k and 1m entities optimally might require way complex structures and logic.