3 ms·
Traversing a short list but frequently still going to have terrible cache performance compared to something like vector. Just use vectors, folks
by dilyevsky 4y ago
Traversing a short list but frequently still going to have terrible cache performance compared to something like vector. Just use vectors, folks
- deleted 4y ago[deleted]
- slaymaker1907 4y agoAllocating a huge chunk of memory all at once when the array grows can also cause a bunch of problems. Linked lists are also much simpler in a multi threaded context.
- dilyevsky 4y agoI’m not an expert in memory allocators but I suspect large allocation is better than many small allocs due to less fragmentation no? I’ll grant you the multithreaded case but if you’re doing that your cache performance is probably crap anyway =)