4 ms·
I generally like real-world analogies, but in this case I do find it too elaborate and unnecessary, too. As a straight answer to the question, it would have su
by Sylos 10y ago
I generally like real-world analogies, but in this case I do find it too elaborate and unnecessary, too.
As a straight answer to the question, it would have sufficed to explain that accessing a larger cache takes more time and resources than accessing a small cache.
Then one could have compared that to desk vs. cabinet once to make it visual, but there's no need to extend that analogy for each individual cache level.
That just exhausts the reader and makes it near-impossible to tell which parts of the analogy are relevant/accurate and which parts are just fluff to make the analogy work.
Alternatively, if you really want to explain each individual detail of caches, then do go with such an elaborate analogy, but then explain at every step to what it corresponds and which part of the analogy is relevant.
You shouldn't write out a page-worth of mostly accurate text and then write a paragraph afterwards to explain how the analogy fits.
Chances are you've lost half of your readership at that point and many (myself included to be honest) will quit reading at exactly that point, because they feel like you're repeating yourself.
- smallnamespace 10y ago> it would have sufficed to explain that accessing a larger cache takes more time and resources than accessing a small cache. I think the point of the long analogy is to hammer in the intuition that physical locality has a concrete price in the real world, and the cache hierarchy is simply a consequence.