exp-cache

[ library, mit, program, unclassified ] [ Propose Tags ]

Please see the README on Github at https://github.com/ChrisCoffey/exp-cache#readme


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.1.0.2
Change log ChangeLog.md
Dependencies array, base (>=4.7 && <5), containers, criterion, deepseq, exp-cache, hashable, psqueues, random, time, unordered-containers [details]
License MIT
Copyright 2018 Chris Coffey
Author Chris Coffey
Maintainer chris@foldl.io
Home page https://github.com/ChrisCoffey/exp-cache#readme
Bug tracker https://github.com/ChrisCoffey/exp-cache/issues
Source repo head: git clone https://github.com/ChrisCoffey/exp-cache
Uploaded by ChrisCoffey at Fri Oct 19 00:44:06 UTC 2018
Distributions NixOS:0.1.0.2
Executables exp-cache-benchmarks
Downloads 602 total (58 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-10-19 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for exp-cache-0.1.0.2

[back to package description]

Expressive Caching

Build Status

Calling this library "Expressive Caching" perhaps implies <Fill this in>. So why does this library exist? Basically, I wanted to explore how different caching strategies behave under simliar workloads. While its generally true that given enough time and effort you can think through how a particular workload will behave, its usually simpler to just try a few represenative samples. This library provides the ability to swap out the expiration strategy for a given cache with a single line of code. Traditionally you'll find an LRU or MRU cache library with all of the expiration logic inlined with the retrival logic. Admittedly, this is more memory efficient, but since caches are all about trading memory for CPU cycles anyways, I decided to separate the expiration logic from the retrival logic. This accomplished my initial goal of making it easy to play the same workload across different strategies, but it also had the hidden benefit of making it easier to implement each eviction strategy.

The library currently supports:

  • FIFO : a queue
  • LRU : Least Recently Used *TODO add a link
  • MRU : Most Recently Used *TODO add a link
  • LFU : Least Frequently Used *TODO add a link
  • RR : Random Replacement *TODO add a link

Its trivial to define alternative eviction strategies using the EvictionStrategy class.