Currently the types registry in the domain is a std::set<unique_ptr<type>>. Types are allocated as a single buffer of variable width, and thus cannot be stored by value. So, since, every node in std::set is allocated, we make two allocations per type.
The solution is to implement a custom set of type (BST or RBT) which would allow the type to also hold node information inside. Then there would be a single allocation per type.
Currently the types registry in the domain is a
std::set<unique_ptr<type>>. Types are allocated as a single buffer of variable width, and thus cannot be stored by value. So, since, every node instd::setis allocated, we make two allocations per type.The solution is to implement a custom set of type (BST or RBT) which would allow the type to also hold node information inside. Then there would be a single allocation per type.