I'm working on a graph database with tens of millions of small nodes containing typically around 8-64 bytes of member data. Is there a faster way of allocating many small class objects such as

class Node
{
    // abstract members
}

class StrNode : Node
{
    string value;
}

// more Node-types...

other than

const nodeCount = 10_000_000;
foreach (0 .. n)
{
    auto node = new Node(someData);
    // connect node...
}

Reply via email to