Hacker News new | past | comments | ask | show | jobs | submit login

'best defence, no be there'

linked lists are seldom the right answer, contiguous blocks of memory are cache - and therefore algorithm - friendly.

the stl performance is usually quite easy to beat in special cases as well (i.e. all game code). some stls are terrible as well - the ms one is riddled with locks and all sorts of sledgehammer thread safety measures, which you just don't need if you know which bits of code are threaded and which arent.




Linked lists are appropriate when you need (usually multiple) sequences of pointers to objects: thus, the real alternative is not vector of t but vector of pointer to t.

A vector of pointers gives no contiguity advantage over an intrusive list during traversal (or any other operation).




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

Search: