5 ms·
Herb Sutter gave a talk somewhat recently going over the basics of working intelligently with the cache. He had some kinda surprising results where naive algori
by a8da6b0c91d 12y ago
Herb Sutter gave a talk somewhat recently going over the basics of working intelligently with the cache. He had some kinda surprising results where naive algorithms on vectors/arrays outperformed the intuitively better list/tree approaches. Circumstances where you'd think all the copying elements and re-sizing std::vector would be expensive turn out not to matter.
http://channel9.msdn.com/Events/Build/2014/2-661 http://channel9.msdn.com/Events/Build/2014/2-661
The basic take-away is to always prefer std::vector and boost::flat_set/flat_map unless you have evidence to the contrary.
- CHY872 12y agoHeard the same thing from Bjarne Stroustrup. The cache properties of vectors are incredible.