[CS61C FA20] Lecture 24.2 - Caches I: Library Analogy — Transcript
Full transcript
- 0:00and welcome back and our way to
- 0:02understand what caches are sometimes it
- 0:04helps to have a really good analogy
- 0:06this library analogy is really very
- 0:08strong so let's take a look at what that
- 0:10means and understand how that connects
- 0:11to what caches are
- 0:13here's the big picture you've seen this
- 0:15before this is the high level
- 0:16abstraction layer of
- 0:18why this is the new school machine
- 0:20structures class not just the old school
- 0:21machine structures class and today we're
- 0:23looking at those two pieces
- 0:24caches and main memory and how they
- 0:26interact
- 0:28here is the picture of the components of
- 0:29the computer just to remind you on the
- 0:31left is the processor
- 0:32control and data path controls the brain
- 0:34data path is the braun the wires
- 0:36you have some interaction with memory
- 0:37and memory has interaction with i
- 0:39i and o but the idea is how would this
- 0:42change
- 0:42if i bring in what caches are so keep
- 0:44this in mind as i start to teach you
- 0:45what caches are
- 0:46in the next slide or two so here's the
- 0:50analogy with libraries and let's think
- 0:51of make sure that we're familiar with
- 0:53how this works
- 0:54so you've got to find a book in a big
- 0:55library you know you're a cal student
- 0:57you're trying to find a book
- 0:58in the stacks so what's your process
- 1:01well you've got to go and go find the
- 1:04catalog card card catalog and it's
- 1:05really large and so you're
- 1:07searching search and searching search
- 1:08and searching and the larger the library
- 1:09the slower that is because there's more
- 1:10things to search through
- 1:12there's also the round trip time to
- 1:14actually walk to the stacks pick up the
- 1:15book
- 1:16and actually retrieve the desired book
- 1:17so there's kind of two stages one is to
- 1:19look at where it is
- 1:20and then the second is to figure out
- 1:22actually go get it and bring it back so
- 1:24that's getting it bring it back and then
- 1:25firing out where
- 1:26it is the larger you make libraries the
- 1:28worse
- 1:29the worse that is imagine the card
- 1:30catalog is you know floors of card
- 1:32catalogs
- 1:33imagine how painful that might be back
- 1:34in the days before search by the way
- 1:36before you know having computers and
- 1:38libraries this is the model just so we
- 1:40appreciate how painful it used to be
- 1:42okay boomer yeah you got it all right
- 1:44here we go
- 1:45[Music]
- 1:46so electronic uh memories
- 1:49i e virtue you know virtual libraries in
- 1:51that sense uh have the same issue
- 1:53and plus the technology as you go to
- 1:57different technologies to store the bits
- 1:59as you go farther away from the cpu the
- 2:02fastest one is the register it's
- 2:03literally the fastest one of the
- 2:04registers and you go farther away from
- 2:06that they get larger and they get much
- 2:07slower and so that the full technology
- 2:09changes there and that's different than
- 2:11libraries larger it's like
- 2:12a longer distance another floor this is
- 2:14like what if another floor required you
- 2:16to walk through quicksand or something
- 2:17that's it's a
- 2:17so it's even worse when you get to um
- 2:20computer memories in terms of
- 2:21a large library well just have to walk
- 2:22longer you know new york public library
- 2:24maybe one of the largest ones in the
- 2:25world whatever
- 2:26it's just walking farther here it's
- 2:27actually walking farther and the time is
- 2:29slower per step
- 2:30it's even worse all right what we want
- 2:33and the ideal case by the way we want a
- 2:35really large memory we want as large as
- 2:37we can
- 2:37but as fast as the smallest element
- 2:40that's the perfect thing
- 2:41boy i want it fastest registers but as
- 2:42big as as as infinity
- 2:45so that's really what we're looking for
- 2:47this is more back setup again
- 2:50back in the 80s um
- 2:53these are two crafts of the graphs
- 2:54between the speed of a processor
- 2:56and the speed of memory uh how many
- 2:58clock cycles
- 3:00were to do to do something and so what
- 3:02you're seeing is the cpu performance has
- 3:04increased
- 3:05incredibly um but in terms of the time
- 3:09to get to memory memory is increased
- 3:11much slower than that and that's
- 3:12that increase of seven percent per year
- 3:14versus fifty-five percent appear this
- 3:15graph ends in 2010 but it and it
- 3:17flattened out you know
- 3:18cpu performance flattened out um after
- 3:20about two thousand four thousand five
- 3:22we call this the sea change we'll
- 3:24actually talk about that in this class
- 3:26um but still that gap was really big and
- 3:28they so the gap is closing but it's not
- 3:29closing very fast
- 3:30so that's an issue so if you think about
- 3:32in 1980 um
- 3:34basically one instruction is the same as
- 3:36dram access so if i happen to
- 3:38need to go to memory that's not a big
- 3:40deal but in 2020
- 3:42to go to memory is a thousand
- 3:44instructions so
- 3:45the cpu if i do nothing else if i'm not
- 3:47smart about how i use my time
- 3:49the cpu is sitting idle for a thousand
- 3:52cycles
- 3:52a thousand full cycles which might not
- 3:54seem a big deal to you because it's at a
- 3:56gigahertz level so it's like what's the
- 3:57big deal but in terms of
- 3:59what if i do this a lot what if i'm
- 4:00doing this a lot that ends up
- 4:03being a bit have a big performance hit
- 4:04on our software especially as i'm trying
- 4:06to
- 4:06compute on larger and larger quantities
- 4:09of data
- 4:09i can't afford to have that that hit
- 4:11that memory hit to do that so we're
- 4:13doing
- 4:14all these whole set of lectures is to
- 4:16deal with this slide here
- 4:17how we try to deal with that disparity
- 4:20between
- 4:20cpu speed and dram speed that's it
- 4:24so in the next couple of lectures that's
- 4:25the last slide on this particular
- 4:27issue we're going to see whether an idea
- 4:29called caches can resolve
- 4:31and solve this problem okay the idea is
- 4:33in the big picture
- 4:34can i be as fast as i can as fast as a
- 4:37register but
- 4:38at the speed sorry as fast registered
- 4:40but at the size of
- 4:42unimaginable size i imagine the size of
- 4:44my hard drive even bigger than that
- 4:46could i work with that okay we'll see
- 4:48the next lecture
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 24.2 - Caches I: Library Analogy by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,052 words across 169 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.