Adaptive Replacement Cache - a Python3 decorator
Mostly for self-study purposes. Use at your own risk. Contribute at GitHub.
from arc_cache import arc_cache
@arc_cache()
def my_heavy_function(arg1):
do_stuff()
Setup a virtualenv using
$ pip3 install tox
$ tox -e develop
$ . .venv/bin/activate
Run all tests using
$ tox
$ python setup.py bdist sdist bdist_wheel
$ gpg -u ... --detach-sign -a dist/...
$ twine upload dist/*
Python 3.5 (I believe) uses a C-implementation of lru_cache.
- ARC - A Self-Tuning, Low Overhead Replacement Cache (2003)
- Adaptive Replacement Cache on Wikipedia
- lru_cache in cpython 3.4