exp-cache

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 2018-10-19T00:44:06Z
Distributions
Executables exp-cache-benchmarks
Downloads 1691 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-10-19 [all 1 reports]

Readme for exp-cache-0.1.0.2

[back to package description]

Expressive Caching

Build Status

Calling this library "Expressive Caching" perhaps implies . 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.