The problem we had with std::vector was how it allocates memory. When the memory allocated for a vector is full, its capacity is increased by allocating a bigger chunk of memory (commonly with double the capacity of the original vector), and all elements
are moved to the new allocation.
We observed that when connections are all put in one big vector, and the number of connections in the vector becomes large, memory consumption from vector growth becomes problematic. We therefore created a new container, BlockVector, to keep memory consumption
under control and avoid moving the elements when increasing the capacity. The BlockVector achieves this by allocating an entire block of a fixed size every time the capacity has to be increased. The BlockVector therefore becomes a vector of vectors, where
the entire size of each new block, which is a new vector in the vector of vectors, is allocated only once when the block is created.
Some benchmarks were done during the review of the PR,
You can find the benchmarks here:
Note that BlockVector was called "Seque" at the time.
Best,
Håkon