1a1a11a / libCacheSim

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

feat(prefetch): add pg #59

Closed zztaki closed 6 months ago

zztaki commented 6 months ago

I have reconstructed the PG prefetching algorithm, and it is worth mentioning that I use direct_hash for all hashtables, which means that I used GINT_TO_POINTER and GPOINTER_TO_INT to convert obj_id or obj_size as the key or the value. Compared to g_int64_hash, this can reduce the overhead of allocation, dereference, and memory release.

Maybe there is a problem on a 32 bit machine, where long and void* maybe are both 4 bytes. :(

1a1a11a commented 6 months ago

I would not worry about the 32-bit issue. It would be good to add some documentation on how to use the prefetching algorithm (maybe a few lines in the cachesim.md and a separate prefetch.md documentation).

1a1a11a commented 6 months ago

If you want to add the documentation after finishing everything, it is fine as well. :)

zztaki commented 6 months ago

If you want to add the documentation after finishing everything, it is fine as well. :)

Yes, I am glad to add the documentations! :)

Do you mind if I create a few PRs later to add documents related to admission and prefetching? Probably within ten hours. 😄

1a1a11a commented 6 months ago

Sounds good! I will merge this PR for now. :)