That the list may be required to be because of strict memory constraint. However, if you are developing on mobile, you may want to use anĪrrayList or ArrayDeque with a good guess of maximum capacity.Much of a difference using either of the Queues. If your requirement is storing 100 or 200 elements, it wouldn't make.At the test size of 9,900,000 elements, the LinkedList approach took ~165% longer than the ArrayDeque approach.As the sets of data get larger, the differences between the ArrayDeque and LinkedList average test time gets larger.Below 10,000 elements, both LinkedList and ArrayDeque tests averaged at a sub 1 ms level.Each tests consists of filling each queue with all objects, then removing them all.For each array size/Queue-implementation combination, 100 tests are run and average time-per-test is calculated.The size of the test array will be varied during the tests.Each String is a different object in memory. Each test object is a 500 character String.If you want to know, take a look at the below benchmark done by Brian (archived). All the people criticizing a LinkedList, think about every other guy that has been using List in Java probably uses ArrayList and an LinkedList most of the times because they have been before Java 6 and because those are the ones being taught as a start in most books.īut, that doesn't mean, I would blindly take LinkedList's or ArrayDeque's side.