1a1a11a / libCacheSim

a high performance library for building cache simulators
GNU General Public License v3.0
159 stars 34 forks source link

Understanding the MRC curves #25

Closed midsterx closed 1 year ago

midsterx commented 1 year ago

Hi,

I am currently using this library to understand the eviction algorithms that I should be exploring. However, both the MRCs over size and MRCs over time seem to indicate that Belady is the worst performer. Am I missing something here? MRC over sizes:

image

MRC over time:

image

The commands that I have used to obtain the plots are as follows (similar to those found in https://github.com/1a1a11a/libCacheSim/tree/develop/scripts#plot-miss-ratio-curves, with belady added as an additional algorithm):

# plot miss ratio over sizes 
python3 plot_mrc_size.py \
--tracepath ../data/twitter_cluster52.csv --trace-format csv \
--trace-format-params="time-col=1,obj-id-col=2,obj-size-col=3,delimiter=,,obj-id-is-num=1" \
--algos=fifo,lru,lecar,s3fifo,belady

# plot miss ratio over time
python3 plot_mrc_time.py \
--tracepath ../data/twitter_cluster52.csv --trace-format csv \
--trace-format-params="time-col=1,obj-id-col=2,obj-size-col=3,delimiter=,,obj-id-is-num=1" \
--algos=fifo,lru,lecar,s3fifo,belady \
--report-interval 120
1a1a11a commented 1 year ago

Hi @midsterx, Belady is only supported on oracleGeneral traces which you can find some from https://ftp.pdl.cmu.edu/pub/datasets/twemcacheWorkload/cacheDatasets/

The oracleGeneral traces have future request information that is used by Belady, csv traces do not have this. I hope this helps.

midsterx commented 1 year ago

Thank you for clarifying this @1a1a11a! I am guessing that no other eviction algorithms use future request information. Is that right?

1a1a11a commented 1 year ago

yes, other algorithms do not use future information (unless the name has Belady or suggests so) BTW, when you do not use "--ignore-obj-size 1" cmd option, you need to use BeladySize algorithm instead of "Belady" Let me know if you encounter other problems

If you would like to contribute and clarify this in README, we welcome all PRs :)

midsterx commented 1 year ago

Hey @1a1a11a, I have created the following PR for the clarifications: https://github.com/1a1a11a/libCacheSim/pull/30

midsterx commented 1 year ago

I have also created the following PR to address the default value while parsing --ignore-obj-size: https://github.com/1a1a11a/libCacheSim/pull/31 The previous value of True does not allow users to consider the object size.

1a1a11a commented 1 year ago

Thank you!