Re:In Defense of Linked Lists
by duskwuff on Saturday November 05, 2022 @01:09AM
(#33478168)
I mean, if you modify the contents of the list nodes in place, sure. But at that point, you're just doing an array with extra steps.
Changing any of the pointers, however, will make memory prefetch much less efficient. CPUs like linear memory access patterns; they're easy to predict. Chasing pointers is much less predictable, even if the pointers are all to the same region of memory.
Changing any of the pointers, however, will make memory prefetch much less efficient. CPUs like linear memory access patterns; they're easy to predict. Chasing pointers is much less predictable, even if the pointers are all to the same region of memory.