Hi guys,
I did a little investigation and I am not entirely sure *why* bitcoin uses prevector. In my tests the 'gain' from prevector is highly platform-dependent, and was never more than 10%. With some newer libstdc++'s, prevector was actually as much as 50% *slower* in some tests.
Here is a small test program that tests prevector vs regular vector-with-reserve: https://github.com/cculianu/prevector_bench
In my opinion prevector just adds technical debt (need to constantly maintain it if standard vector changes, etc) without any huge benefit that I can ascertain.
I did a little digging and I can't find out the rationale core used to add it in the first place.
Anyway -- if you have time check out my little prevector_bench utility and let me know what you think and/or how it performs on your platform/c++ lib version.