Index/Simulators

Get Premium
Simulators

Cache eviction

Read keys through an LRU, an LFU and a FIFO cache at once, and watch which keys each one keeps, which it throws out, and its hit rate.

Three caches, 4 slots each
Read a key:
Or play:

Each cache holds 4 keys. Read keys and watch which ones each policy keeps. Or play a scenario.

  • LRU

    —

    room for 4

    Holds nothing.

    0/0 · 0%
  • LFU

    —

    room for 4

    Holds nothing.

    0/0 · 0%
  • FIFO

    —

    room for 4

    Holds nothing.

    0/0 · 0%
Slots run from the key each cache would keep longest to the one it evicts next, outlined in red. A miss loads the key; when the cache is full, the next one out makes room.
Read the explanation in Caching, section 4.4