Open
Description
我注意到 @huangrihang 经常增加一些计数变量。类似的需求,我们有必要规范缓存方案。
根据StackOverflow的回答,有几个备选方案:
- 标准库
functools
的lru_cache
。它的功能似乎不是我们直接需要的。
Decorator to wrap a function with a memoizing callable that saves up to the maxsize most recent calls. It can save time when an expensive or I/O bound function is periodically called with the same arguments.
-
不过有基于它直接实现的库,比如cachetools
-
beaker
: 这是一个用在Web应用的缓存框架。 -
pymemcache
也是一个比较主流的方案。 -
cachesql
: SQL缓存。
Metadata
Metadata
Assignees
Labels
No labels