3 ms·
They do mention that it’s more efficient than lru_cache, which isn’t surprising since cache is a lot simpler (just throw all the values in a dict keyed by the a
by nneonneo 6y ago
They do mention that it’s more efficient than lru_cache, which isn’t surprising since cache is a lot simpler (just throw all the values in a dict keyed by the args).
- uyt 6y agoNo they are saying it's more efficiently that lru_cache with a finite maxsize. Implementation-wise it's identical to using maxsize=None. See source: https://github.com/python/cpython/blob/3.9/Lib/functools.py#L652 https://github.com/python/cpython/blob/3.9/Lib/functools.py#...
- dralley 6y agoIt says it's more efficient than lru_cache with a size specified, it doesn't say that it's more efficient than lru_cache without one.