During my talk “The Quantum Physics of Java” at Oredev, @holly_cummins tweeted about the beer cache hierarchy. It is an analogy with which my former colleague, Richard Thompson, came up to describe the differences between memory access times. This tweet hit a nerve with more than 1.500 Retweets and more than 900 Favorites. It also inspired quite a few people to extend the analogy to other areas. Here are some of my favorites:
This is the tweet with which it all began.
L1 cache is a beer in hand, L3 is fridge, main memory is walking to the store, disk access is flying to another country for beer. @net0pyr
— Holly Cummins (@holly_cummins) November 6, 2014
And shortly after @holly_cummins added the missing piece.
If anyone is desperate for the missing part of the analogy, "L2 cache is a beer cooler by the sofa." @net0pyr
— Holly Cummins (@holly_cummins) November 7, 2014
Immediately some people extended the analogy to other access times…
… registers …
@holly_cummins @normanmaurer @net0pyr CPU register is beer literally in your mouth
— meat (@meat) November 6, 2014
@holly_cummins @normanmaurer @net0pyr register is shotgunning a beer.
— Ryan Zezeski (@rzezeski) November 6, 2014
… remote direct memory access (RDMA) …
@holly_cummins @bobpoekert @net0pyr What about the network? RDMA is like texting someone for beer, and it eventually ending up in your mouth
— Sargun Dhillon (@sargun) November 7, 2014
… SSD and tape …
@holly_cummins @stuherbert @net0pyr SSD – going to the brewery in the next town? Tape backup: archaeological excavations required?
— Matt Parker (@MattLlt) November 7, 2014
… network …
…@holly_cummins @net0pyr and a network round-trip is a space mission to Pluto?
— Pozorvlak (@pozorvlak) November 7, 2014
… database requests …
.@holly_cummins @adrienneleigh @net0pyr So, querying a SQL database over a network connection… is what, an orbital flight? *BOGGLES*
— Brian Rice (@BrianTRice) November 7, 2014
… more SSD …
@holly_cummins @net0pyr @hanshuebner But SSD disk access is teleportation to another country for beer.
— Didier Verna (@didierverna) November 8, 2014
… and more tape.
@holly_cummins @hpcprogrammer @net0pyr and tape is beer on Mars. You'll never know if really exists until you try to fetch it…
— Peter Kjellström (@nsccap) November 8, 2014
Some people quickly pointed out that the analogy for disk access was way off (to my defense, it was just the part of a joke). 🙂
@alexkli @holly_cummins @michaelmarth more like a sail boat than a plane, oh & your beer is in Singapore, or maybe Australia 🙂
— Ian Massingham (@IanMmmm) November 8, 2014
@holly_cummins @net0pyr @damicosimone disk access is asking somebody else to import beer from another country :).
— Matteo Collina (@matteocollina) November 9, 2014
@holly_cummins @net0pyr flying but needing to get a passport first
— Chimichenga (@secretasianman) November 16, 2014
But what amazed me the most was how people extended the beer cache analogy.
@holly_cummins @ViIvanov @net0pyr Swapping is when workers come to your place and carry your fridge to another country. Scary.
— Слоупок опаздывает (@is_a_cdr) November 7, 2014
Some focused on the actual act of drinking of which the following was one of the family-friendly one.
@holly_cummins @net0pyr A cache miss is trying to take a sip and spilling beer down yourself?
— Jordan Blake (@Jksblkt) November 17, 2014
I always knew that beer and out-of-order execution are related, …
@holly_cummins @loesh666 @net0pyr Fortunately, you can do something productive while you send someone else abroad. Most of the time. #OoOE
— Mattias Johansson (@folkol) November 18, 2014
… but that you can even explain prefetching with the beer cache analogy was a surprise.
@holly_cummins @ffee_machine @net0pyr sometimes you have a delivery on the way from the store when you're almost out; prefetch!
— Calvin Walton (@kepstin) November 21, 2014
Enjoy your weekend!