-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Simulator
Ben Manes edited this page Dec 6, 2021
·
42 revisions
The simulator includes a family of eviction policies and distribution generators. This helps when investigating whether a policy is a good fit for a usage scenario.
Run the Simulator in an IDE after specifying the desired configuration. Alternatively, run at the command line using:
# Single run, displays ascii table by default
gradlew simulator:run -q
# Multiple runs, writes to a combined file
gradlew simulator:simulate -q \
--maximumSize=<comma separated list; supports _ numeric literal> \
--format=<csv, tsv>
The following trace formats are supported.
Traces | Location | Traces | Location |
---|---|---|---|
AdaptSize | author's simulator | Address (UCSD) | git repository |
ARC | author's homepage | Cache2k | git repository |
CameLab | project's homepage | Cloud Physics | git repository |
Corda | git repository | Gradle | git repository |
Kaggle | project's homepage | LIRS | git repository |
LRB | author's simulator | Scarab | git repository |
SNIA | project's homepage | Tragen | project's homepage |
project's homepage | UMass | project's homepage | |
WikiBench | project's homepage |
The rewriter utility converts traces from one format to another. This can be helpful when comparing a policy written in an alternative simulator that lacks support for a trace format.
gradlew :simulator:rewrite -q \
--inputFormat=<trace format> \
--inputFiles=<comma separated paths> \
--outputFormat=<trace format> \
--outputFile=<path>
Due to batching and broadcasting, the timings are only comparable when running each policy independently.
╔══════════════════════╤══════════╤════════╤════════╤══════════╤═══════════╤══════════════════╤══════════╗
║ Policy │ Hit rate │ Hits │ Misses │ Requests │ Evictions │ Steps │ Time ║
╠══════════════════════╪══════════╪════════╪════════╪══════════╪═══════════╪══════════════════╪══════════╣
║ opt.Clairvoyant │ 58.79 % │ 9,323 │ 6,535 │ 15,858 │ 6,035 │ ? │ 278.0 ms ║
╟──────────────────────┼──────────┼────────┼────────┼──────────┼───────────┼──────────────────┼──────────╢
║ sketch.WindowTinyLfu │ 56.11 % │ 8,898 │ 6,960 │ 15,858 │ 6,460 │ 15,858 (100 %) │ 315.2 ms ║
╟──────────────────────┼──────────┼────────┼────────┼──────────┼───────────┼──────────────────┼──────────╢
║ irr.Lirs │ 55.97 % │ 8,876 │ 6,982 │ 15,858 │ 6,482 │ 27,689 (174 %) │ 311.0 ms ║
╟──────────────────────┼──────────┼────────┼────────┼──────────┼───────────┼──────────────────┼──────────╢
║ adaptive.Arc │ 49.39 % │ 7,833 │ 8,025 │ 15,858 │ 7,525 │ 15,858 (100 %) │ 166.3 ms ║
╟──────────────────────┼──────────┼────────┼────────┼──────────┼───────────┼──────────────────┼──────────╢
║ linked.Lru │ 46.51 % │ 7,375 │ 8,483 │ 15,858 │ 7,983 │ 15,858 (100 %) │ 128.2 ms ║
╟──────────────────────┼──────────┼────────┼────────┼──────────┼───────────┼──────────────────┼──────────╢
║ linked.Fifo │ 40.72 % │ 6,457 │ 9,401 │ 15,858 │ 8,901 │ 15,858 (100 %) │ 163.6 ms ║
╚══════════════════════╧══════════╧════════╧════════╧══════════╧═══════════╧══════════════════╧══════════╝