Hacker News new | ask | show | jobs
by whateveracct 3432 days ago
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.
1 comments

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.