Hacker News new | ask | show | jobs
by mohaine 3433 days ago
The performance issue still stands. Linked Lists are often MUCH slower then array backed lists on modern hardware. This is true even when doing lots of inserts. Having all your list in the CPU cache is just too much of a performance gain over having it spread out in random locations.
1 comments

Depending on your GC, linked lists won't be "spread out in random locations." The nodes will be allocated right next to each other in the case where you're building up a list iteratively.
How does the GC change allocations?

While I agree that this Linked list memory layout should be optimized, with real world tests Array backed normally win by a large margin.