Data Structures Most Prone to Irregular Access
Linked lists, hash tables, and tree structures are notorious for causing irregular memory access patterns, leading to frequent cache misses. This is due to their non-contiguous memory allocation and pointer-chasing nature.
The top 3
- Top 3 Data Structures for Cache Misses: Linked lists, hash tables, and tree structures are infamous for irregular memory access patterns, frequently leading to cache misses and substantial performance degradation.
- Pointer Chasing: The Ultimate Cache Killer: Data structures that rely heavily on pointers to non-contiguous memory locations, such as linked lists and many graph implementations, force the CPU to 'chase' pointers, resulting in highly irregular access and severe cache miss penalties.
- Random vs. Sequential Access: The Latency Divide: Random memory access, characteristic of hash table probes or sparse matrix operations, can be orders of magnitude slower than sequential access in arrays due to the high cost of cache misses and main memory latency.
Sources
Open the full topic