3 ms·
I'm not in the Rust community, but it seems like one could have their cake and eat it too, using OOP with DOD storage. * Use a special allocator for objects
by eyesee 6y ago
I'm not in the Rust community, but it seems like one could have their cake and eat it too, using OOP with DOD storage.
* Use a special allocator for objects which reserves a vector slot from your structure-of-arrays.
* Objects records are offsets instead of pointers
* Object definition includes getter/setters which index the columnar vectors
* Store fields declared 'columnar' in a value vector. This could even give flexibility to group columns for locality where needed, and allow ancillary data to be stored in a "leftover" struct.
- adamnemecek 6y agoYes, generational arena allocations are very popular. The larger question is more about the application architecture. Like where does one handle user input? Where does rendering happen? Etc.