@lupyuen Yes, I have known about this for about 20 years. I recall one benchmark that to outperform the vector-insert-in-the-middle for a random element, the collection in the benchmark had to be >50,000 entries.

Then to complicate further, it is language sensitive, since for objects, OO languages (all?) need to make the vector a vector-of-pointers-to-objects, compared to an array-of-structs (or struct-of-arrays) in C.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.