Nodes are currently stored in individual Boxes, but this means we make a heap allocation for each new node and also don't get any cache locality.
Instead, we should store nodes in pages organized by the shape of the graph (e.g. the root of that subtree is node 0), then make a reference type which stores the reference to the containing page and the node index within the page (while also somehow respecting there borrow checker rules).
Nodes are currently stored in individual
Box
es, but this means we make a heap allocation for each new node and also don't get any cache locality.Instead, we should store nodes in pages organized by the shape of the graph (e.g. the root of that subtree is node 0), then make a reference type which stores the reference to the containing page and the node index within the page (while also somehow respecting there borrow checker rules).