Re:Friday Facts #371 - Apple Silicon
by donatj on Friday November 25, 2022 @11:24AM
(#33743886)
Factorio I think is particularly poorly suited to memory managed languages. My factory is enormous, hundreds of thousands of machines all doing their thing in real time. Thousands of robots flying around delivering goods. I think that really does in fact demand high level optimization.
[ Parent
| on HN ]
Factorio does really weird things with memory (the deterministic simulation effectively reads all memory every tic) that makes it not perform like many applications are expected to.
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.