DEV Community

Discussion on: Arrays vs Lists

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

arrays are listed. What you probably mean is a linked list, which is another implementation of lists.

As for the performance characteristics of both days structures, modern cpus with lots of caching logic make those a lot more complicated. Naive arrays will almost always perform better than naive linked lists, even in random insertions, and a clever allocator can have a huge impact on list performance as it can mean the difference between list items being mostly consecutive memory regions or spread randomly all over the ram.