Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

The basic take-away is to always prefer std::vector and boost::flat_set/flat_map unless you have evidence to the contrary.



Heard the same thing from Bjarne Stroustrup. The cache properties of vectors are incredible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: