4 ms·
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 insert
by mohaine 10y 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.
- whateveracct 10y agoDepending 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.
- mohaine 10y agoHow 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.