Texonom
Texonom
/
Engineering
Engineering
/Hardware Engineering/Computer Architecture/Memory Hierarchy/
CPU Cache
Search

CPU Cache

Creator
Creator
Seong-lae Cho
Created
Created
2019 Nov 5 5:17
Editor
Editor
Seong-lae Cho
Edited
Edited
2025 Jan 4 22:3
Refs
Refs
Caching
Cache Notion
Cache Line
Cache Locality
Cache Address
Cache Operation
Cache Identification
Cache Policy
Cache Strategy
Cache Miss
Multilevel Caches
Cache Stampede
Cache Invalidation
Branch Prediction
 
 
Cache Usage
Cache Idea
 
 
 
 
Radix Sort
The RAM myth
The RAM myth is a belief that modern computer memory resembles perfect random-access memory. Cache is seen as an optimization for small data: if it fits in L2, it’s going to be processed faster; if it doesn’t, there’s nothing we can do. Most likely, you believe that code like this is the fastest way to shard data (I’m using Python as pseudocode; pretend I used your favorite low-level language): groups = [[] for _ in range(n_groups)] for element in elements: groups[element.group].append(element) Indeed, it’s linear (i.e. asymptotically optimal), and we have to access random indices anyway, so cache isn’t going to help us in any case. In reality, when the number of groups is high, this is leaving a lot of performance on the table, and certain asymptotically slower algorithms can perform sharding significantly faster. They are mostly used by on-disk databases, but, surprisingly, they are useful even for in-RAM data.
The RAM myth
https://purplesyringa.moe/blog/the-ram-myth/
The RAM myth
 
 

Recommendations

Texonom
Texonom
/
Engineering
Engineering
/Hardware Engineering/Computer Architecture/Memory Hierarchy/
CPU Cache
Copyright Seonglae Cho