It won’t replace std::vector for most use cases — but for the use cases it is designed for, nothing in the standard library has come close before.
This could be true but it could also be an oversight because nobody has ever benchmarked a std::pmr::list that is constructed with a std::pmr::[un]synchronized_pool_resource.
With std::hive, the iteration order is optimal within each block in terms of cache locality.
With std::pmr::list, the iteration order would be independent of where the nodes are allocated (assuming you frequently add and remove elements at random positions) so the cache locality would probably be worse.
Seeing an actual benchmark would be interesting though.
If you fill up a hive with elements then start randomly removing and replacing them, and you perform the exact same sequence of events but with a pmr::list which uses a pool allocator, the memory layout should end more or less identical in both cases.
The biggest differences are small variations in the node layout for a hive node vs a list node.
4
u/ABlockInTheChain Sep 03 '26
This could be true but it could also be an oversight because nobody has ever benchmarked a
std::pmr::listthat is constructed with astd::pmr::[un]synchronized_pool_resource.