3 ms·
Don't see any problem there, how does it relate to portability? Anyway games are going to pre-allocate large arrays and work on them, for cache affinity. That
by deepsun 4y ago
Don't see any problem there, how does it relate to portability?
Anyway games are going to pre-allocate large arrays and work on them, for cache affinity. That doesn't depend on C++ vs. Java. No need to create a separate object for each item in your factory, but rather a row in the array(s).
And even if you do create a new object for each item, it's better to do that on heavily optimized heap, than manually allocating/deallocating memory in the same thread. You end up writing that heap in C++ anyway.