PYTHON PROGRAMMING

Make Python Faster by Caching Functions: Memoization

The article discusses memoization using the Python standard library. The functools.lru_cache decorator makes this so simple!

Marcin Kozak
Towards Data Science
11 min readNov 11, 2023

--

You can request Python to remember what functions have returned already — and to use it. Photo by Kelly Sikkema on Unsplash

We all know Python can be slow:

--

--

A full professor, interdisciplinary researcher, data scientist, statistician, Python, R and Go developer, open-source contributor — and a devoted writer