A list
uses a lot of memory since it adds a pointer to each node, and it is not contiguous, the memory is there fragmented ... A List of arrays
in my opinion is a lot better. For example if I am managing 100 object, A list
of 5 array
s of 20 is a lot better than a List
of 100, only 5 Pointers added vs 100 pointers, we win locality, when using the same array
, and we have less fragmentation.
I did some research about this, but I can't find any interesting article about this, so I thought I am missing something.
What can be the benefit of using a List
over a List of arrays
?
EDIT : This is definetely not Array vs List ... It is more like why putting only one element per list Node if it's possible to put more