Choosing the best implementation for your use case
3
Choosing the most common operations for benchmark
4
Can you apply the On complexity to your use case?
5
Using JMH to run your benchmarks
6
Reading elements from the beginning and the end of a list
7
Reading elements from the middle of a list
8
Introducing pointer chasing
9
Benching the impact of pointer chasing on LinkedList
10
Iterating over a list with an index or an Iterator
11
Creating an array-based list to speed up your iterations
12
Wrapping up pointer chasing
13
ArrayList caveats: insertion, deletion, and resizing
14
Benching insertion and resizing for ArrayList
15
Comparing inserting and adding for ArrayList and LinkedList
16
Comparing the memory consumption of ArrayList and LinkedList
17
Reducing your memory footprint by using trimToSize
18
Wrapping up performances and memory consumption
19
Outro
Description:
Dive into a comprehensive 31-minute tutorial exploring the differences between ArrayList and LinkedList in Java's Collections Framework. Learn how to choose the optimal implementation for your application by benchmarking performance and analyzing memory consumption. Discover the impact of common operations, understand O(n) complexity, and utilize JMH for accurate benchmarking. Explore reading elements from different list positions, investigate pointer chasing, and compare iteration methods. Examine ArrayList's caveats, including insertion, deletion, and resizing. Compare insertion and addition operations between ArrayList and LinkedList, and analyze their memory footprints. Gain insights on optimizing memory usage with trimToSize() and wrap up with a thorough understanding of performance considerations for these essential Java data structures.
Choosing Between ArrayList and LinkedList in Java - Performance and Memory Considerations