4 ms·
> Linked lists have real performance benefits in some applications. Maybe in 0.01% of the cases. In reality they just ruin your cache and memory allocator perf
by otabdeveloper4 4y ago
> Linked lists have real performance benefits in some applications.
Maybe in 0.01% of the cases. In reality they just ruin your cache and memory allocator performance for no real good reason.
- mtlmtlmtlmtl 4y agoIn many cases you can get around these issues by being a little more clever in how you allocate nodes. In some cases you don't have the luxury of allocating all elements next to eachother anyway, in which case an intrusive linked list is often the best option to minimise copying. You might say use a vector of pointers or a circular buffer, but if you're in a timing sensitive context you might be unable to realloc. Hell, memory allocators themselves are often implemented using some form of linked list. You tend to see them quite a bit at very low levels like in kernels.