JYang1997 / Priority-Cache-Sim

random sampling based cache replacement simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Priority-Cache-Simulator

Random sampling based cache replacement simulator. On cache eviction, simulator randomly pick K objects, then evicts the object with smallest priority value.

To add a new replacement policy, in src/priority.c and inc/priority.h add following for the new replacement:

  • CreatePriority()
  • UpdatePriorityOnHit()
  • UpdatePriorityOnEvict()
  • MinPriorityItem()

Avialiable Policies: lru, mru, in-cache-lfu, perfect-lfu, lhd, hc, etc.

example_main.c is an example code for how to use the simulator.

compile and run example

make
./priority_cache input.txt sample_size policy_name

About

random sampling based cache replacement simulator

License:MIT License


Languages

Language:C 99.6%Language:Makefile 0.4%