YouTube2Text

[CS61C FA20] Lecture 24.2 - Caches I: Library Analogy — Transcript

by CS 61C Departmental · 1,052 words · 169 segments · language en · Watch on YouTube

Full transcript

  1. 0:00and welcome back and our way to
  2. 0:02understand what caches are sometimes it
  3. 0:04helps to have a really good analogy
  4. 0:06this library analogy is really very
  5. 0:08strong so let's take a look at what that
  6. 0:10means and understand how that connects
  7. 0:11to what caches are
  8. 0:13here's the big picture you've seen this
  9. 0:15before this is the high level
  10. 0:16abstraction layer of
  11. 0:18why this is the new school machine
  12. 0:20structures class not just the old school
  13. 0:21machine structures class and today we're
  14. 0:23looking at those two pieces
  15. 0:24caches and main memory and how they
  16. 0:26interact
  17. 0:28here is the picture of the components of
  18. 0:29the computer just to remind you on the
  19. 0:31left is the processor
  20. 0:32control and data path controls the brain
  21. 0:34data path is the braun the wires
  22. 0:36you have some interaction with memory
  23. 0:37and memory has interaction with i
  24. 0:39i and o but the idea is how would this
  25. 0:42change
  26. 0:42if i bring in what caches are so keep
  27. 0:44this in mind as i start to teach you
  28. 0:45what caches are
  29. 0:46in the next slide or two so here's the
  30. 0:50analogy with libraries and let's think
  31. 0:51of make sure that we're familiar with
  32. 0:53how this works
  33. 0:54so you've got to find a book in a big
  34. 0:55library you know you're a cal student
  35. 0:57you're trying to find a book
  36. 0:58in the stacks so what's your process
  37. 1:01well you've got to go and go find the
  38. 1:04catalog card card catalog and it's
  39. 1:05really large and so you're
  40. 1:07searching search and searching search
  41. 1:08and searching and the larger the library
  42. 1:09the slower that is because there's more
  43. 1:10things to search through
  44. 1:12there's also the round trip time to
  45. 1:14actually walk to the stacks pick up the
  46. 1:15book
  47. 1:16and actually retrieve the desired book
  48. 1:17so there's kind of two stages one is to
  49. 1:19look at where it is
  50. 1:20and then the second is to figure out
  51. 1:22actually go get it and bring it back so
  52. 1:24that's getting it bring it back and then
  53. 1:25firing out where
  54. 1:26it is the larger you make libraries the
  55. 1:28worse
  56. 1:29the worse that is imagine the card
  57. 1:30catalog is you know floors of card
  58. 1:32catalogs
  59. 1:33imagine how painful that might be back
  60. 1:34in the days before search by the way
  61. 1:36before you know having computers and
  62. 1:38libraries this is the model just so we
  63. 1:40appreciate how painful it used to be
  64. 1:42okay boomer yeah you got it all right
  65. 1:44here we go
  66. 1:45[Music]
  67. 1:46so electronic uh memories
  68. 1:49i e virtue you know virtual libraries in
  69. 1:51that sense uh have the same issue
  70. 1:53and plus the technology as you go to
  71. 1:57different technologies to store the bits
  72. 1:59as you go farther away from the cpu the
  73. 2:02fastest one is the register it's
  74. 2:03literally the fastest one of the
  75. 2:04registers and you go farther away from
  76. 2:06that they get larger and they get much
  77. 2:07slower and so that the full technology
  78. 2:09changes there and that's different than
  79. 2:11libraries larger it's like
  80. 2:12a longer distance another floor this is
  81. 2:14like what if another floor required you
  82. 2:16to walk through quicksand or something
  83. 2:17that's it's a
  84. 2:17so it's even worse when you get to um
  85. 2:20computer memories in terms of
  86. 2:21a large library well just have to walk
  87. 2:22longer you know new york public library
  88. 2:24maybe one of the largest ones in the
  89. 2:25world whatever
  90. 2:26it's just walking farther here it's
  91. 2:27actually walking farther and the time is
  92. 2:29slower per step
  93. 2:30it's even worse all right what we want
  94. 2:33and the ideal case by the way we want a
  95. 2:35really large memory we want as large as
  96. 2:37we can
  97. 2:37but as fast as the smallest element
  98. 2:40that's the perfect thing
  99. 2:41boy i want it fastest registers but as
  100. 2:42big as as as infinity
  101. 2:45so that's really what we're looking for
  102. 2:47this is more back setup again
  103. 2:50back in the 80s um
  104. 2:53these are two crafts of the graphs
  105. 2:54between the speed of a processor
  106. 2:56and the speed of memory uh how many
  107. 2:58clock cycles
  108. 3:00were to do to do something and so what
  109. 3:02you're seeing is the cpu performance has
  110. 3:04increased
  111. 3:05incredibly um but in terms of the time
  112. 3:09to get to memory memory is increased
  113. 3:11much slower than that and that's
  114. 3:12that increase of seven percent per year
  115. 3:14versus fifty-five percent appear this
  116. 3:15graph ends in 2010 but it and it
  117. 3:17flattened out you know
  118. 3:18cpu performance flattened out um after
  119. 3:20about two thousand four thousand five
  120. 3:22we call this the sea change we'll
  121. 3:24actually talk about that in this class
  122. 3:26um but still that gap was really big and
  123. 3:28they so the gap is closing but it's not
  124. 3:29closing very fast
  125. 3:30so that's an issue so if you think about
  126. 3:32in 1980 um
  127. 3:34basically one instruction is the same as
  128. 3:36dram access so if i happen to
  129. 3:38need to go to memory that's not a big
  130. 3:40deal but in 2020
  131. 3:42to go to memory is a thousand
  132. 3:44instructions so
  133. 3:45the cpu if i do nothing else if i'm not
  134. 3:47smart about how i use my time
  135. 3:49the cpu is sitting idle for a thousand
  136. 3:52cycles
  137. 3:52a thousand full cycles which might not
  138. 3:54seem a big deal to you because it's at a
  139. 3:56gigahertz level so it's like what's the
  140. 3:57big deal but in terms of
  141. 3:59what if i do this a lot what if i'm
  142. 4:00doing this a lot that ends up
  143. 4:03being a bit have a big performance hit
  144. 4:04on our software especially as i'm trying
  145. 4:06to
  146. 4:06compute on larger and larger quantities
  147. 4:09of data
  148. 4:09i can't afford to have that that hit
  149. 4:11that memory hit to do that so we're
  150. 4:13doing
  151. 4:14all these whole set of lectures is to
  152. 4:16deal with this slide here
  153. 4:17how we try to deal with that disparity
  154. 4:20between
  155. 4:20cpu speed and dram speed that's it
  156. 4:24so in the next couple of lectures that's
  157. 4:25the last slide on this particular
  158. 4:27issue we're going to see whether an idea
  159. 4:29called caches can resolve
  160. 4:31and solve this problem okay the idea is
  161. 4:33in the big picture
  162. 4:34can i be as fast as i can as fast as a
  163. 4:37register but
  164. 4:38at the speed sorry as fast registered
  165. 4:40but at the size of
  166. 4:42unimaginable size i imagine the size of
  167. 4:44my hard drive even bigger than that
  168. 4:46could i work with that okay we'll see
  169. 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.