The choice of datastructure typically depends on your data *AND* your access patterns.
There are a lot of things to consider
- each node of a list is an object, it needs some overhead (memory management) and at least 2 members for a double linked list. So each node is at least 8+2*4 bytes = 16 bytes - if you really have 4000*1000 objects so about 64mb - thats quite a lot (it's all overhead, not a single byte used for your own needs)
- an array only needs one block and 4 byte per object reference
- sequential access is not that different in terms of speed but if your lists change often you'll find your nodes quite distributed in memory so lots of iterations will end quite slower than using an array because of cash misses.
- random access on arrays is o(1) and on lists o(n) so using lists with up to 1000 elements may really slow down you quite a lot (if you have to do random access)
So in general - you just have to give us more information about your data/access patterns for a good recommendation.
There are a lot of things to consider
- each node of a list is an object, it needs some overhead (memory management) and at least 2 members for a double linked list. So each node is at least 8+2*4 bytes = 16 bytes - if you really have 4000*1000 objects so about 64mb - thats quite a lot (it's all overhead, not a single byte used for your own needs)
- an array only needs one block and 4 byte per object reference
- sequential access is not that different in terms of speed but if your lists change often you'll find your nodes quite distributed in memory so lots of iterations will end quite slower than using an array because of cash misses.
- random access on arrays is o(1) and on lists o(n) so using lists with up to 1000 elements may really slow down you quite a lot (if you have to do random access)
So in general - you just have to give us more information about your data/access patterns for a good recommendation.