GithubHelp home page GithubHelp logo

dbaarda / dlfucache Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 1.0 323 KB

A Decaying Least Frequently Used Cache implementation.

License: GNU General Public License v3.0

Python 100.00%
cache caching cache-simulator

dlfucache's People

Contributors

dbaarda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

konradreiche

dlfucache's Issues

Implement ADLFUCache properly.

This requires good feedback on the cache performance that indicates if a higher or lower T value would perform better.

It's complicated partly because it's nearly impossible to know what the optimal performance of the cache should be, and the signals available when we only keep the decaying hit-count for each entry doesn't give a lot of signal. The optimal hit-rate depends on the load

One possible measure of the cache performance is "fit", where we keep a decaying average of the hit-count values for cache hits. If the current cache hits reflect the current distribution of entry counts, then the average hit-count should be;

Pentry = entry_count/count_sum
Centry = entry_count * Pentry = entry_count^2 / count_sum
Cmean = sum(entry_count^2) / count_sum = count_sum2 / count_sum
fit = count_avg / Cmean 

Where;

Pentry is the probability of hitting a particular entry 'e'.
Centry is the expected count-sum contribution from hits on a single entry.
Cmean is the expected average hit-count.
fit is the ratio of the average hit-count to the expected hit-count.

in practice this does seem to give a fairly good indication of when the cache is working well, but it doesn't tell you if T should be increased or decreased when it is not working well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.