[Numpy-discussion] Changing FFT cache to a bounded LRU cache

Antoine Pitrou solipsis at pitrou.net
Mon May 30 04:06:41 EDT 2016


On Sat, 28 May 2016 20:19:27 +0200
Sebastian Berg <sebastian at sipsolutions.net> wrote:
> 
> The complexity addition is a bit annoying I must admit, on python 3
> functools.lru_cache could be another option, but only there.

You can backport the pure Python version of lru_cache for Python 2 (or
vendor the backport done here:
https://pypi.python.org/pypi/backports.functools_lru_cache/).
The advantage is that lru_cache is C-accelerated in Python 3.5 and
upwards...

Regards

Antoine.





More information about the NumPy-Discussion mailing list