m0lentum/starframe

Pooling

Closed this issue · 1 comments

The way nodes are currently reused, things are going to become fragmented over time as slots are taken by shapes that are different from the original. Frequently created and destroyed objects should have a way of only allowing their slots to be used by the same shape again.

Also, pools would (well, not necessarily but should) allow to limit how many of a specific object are in the world and preallocate memory for them so we need less allocations at runtime.

Maybe a special layer like with pinning, but the deletion algorithm knows about it and puts the vacant nodes in a pool instead of the global queue if it finds a node on that layer. The edges between nodes should be stored in the pool as well so we can restore them automatically. It'd be difficult but nice to also stop new things from being connected to stuff in a pool at runtime so its structure couldn't diverge.

Closing all issues, moving planning to my notes repo for more freely writing down ideas