14. Caching and Cache-Efficient Algorithms

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 13

  • @leixun
    @leixun 4 роки тому +25

    *My takeaways*
    1. Cache hardware 0:35
    2. Fully associative cache 4:32
    3. Direct-mapped cache 7:40
    4. Set associative cache 11:50
    5. Taxonomy of cache misses 14:45: cold miss, capacity miss, conflict miss, sharing miss
    - Conflict miss example 19:20
    6. Ideal cache model 26:38
    7. Cache analysis of matrix multiplication 42:40
    - Tiled matrix multiplication 54:00
    - Divide and conquer 1:02:00: Cache-oblivious algorithms 1:12:37

  • @skeptorr
    @skeptorr 8 місяців тому

    A better and simpler description of Direct-Mapped is to consider each set as a completely different physical cache block, not as a part of a single cache.
    So for example K=1
    You have 1 cache block that holds 1 red cache line.
    You have a different cache block (instance) for blue etc.

  • @LemonChieff
    @LemonChieff 3 роки тому +7

    It would have been nice if the lecture included a live demo (e.g.: a benchmark [Yes, I just really like benchmarks]). 🤔

  • @chuntingli6559
    @chuntingli6559 2 роки тому +1

    34:37 anyone knows why do we need to particuarly assume N < M/3, not just N < M? Seems it doesn't affect the derivation below...

    • @HoagyCunningham
      @HoagyCunningham 2 роки тому

      I think that you need N < M/3 because the segments aren't guaranteed to fit into the cache efficiently because the cache is stored line by line. If the line size is x bytes, the worst case would be a segment of x+2 bytes which went just over the beginning and end of a line, and so you would need 3x bytes of cache to store x+2 bytes of data. In the limit as x grows, this means that you need N

  • @JT-mr3db
    @JT-mr3db 3 місяці тому +1

    These students are basically paying for someone to read them a text book.

  • @qng9555
    @qng9555 3 роки тому +1

    Isn't the stack also cached?

    • @voltflake
      @voltflake Рік тому

      Cache doesn't know which memory is stack and which is on heap. They're the same plain ram memory for cache. But by nature, stack is more cache friendly because usually things in stack are very close to each other.

  • @riemann4151
    @riemann4151 3 роки тому +1

    I think such topics should have been taught by Prof. Leiserson himself.

  • @LordMoopCow
    @LordMoopCow 3 роки тому

    "Who doesn't care"
    Uhhhhhh yeah... |Raises hand|

  • @esteralfiah4861
    @esteralfiah4861 Рік тому

    Andreas.kristanto.the.power.tuhan.fisika.production.alat.tools.good.Mit.open.course.ware.looking.good