News for hackers. Stuff that matters.
Re:On lists, cache, algorithms, and microarchitecture by hyperman1 on Friday May 03, 2019 @04:51PM (#19822158)
I wonder if it is worth it to create a hybrid data structure: A linked list of arrays. Say you'd tune it so each array fits in the L1 cache. You don't need a huge chunk of contiguous memory, but still gain most of the performance gains of arrays. Iteration gets a lot more complicated, of course.
Re:On lists, cache, algorithms, and microarchitecture by htfy96 on Saturday May 04, 2019 @01:12AM (#19824596)
It's called unrolled linked list. (https://en.m.wikipedia.org/wiki/Unrolled_linked_list). Note that if you can make sure each chuck contains sqrt(N) elements, then you can achieve insertion/deletion/lookup in O(sqrt(N)) time