Skip to content

Python项目的缓存方案 #3

Open
@Guo-Zhang

Description

@Guo-Zhang

我注意到 @huangrihang 经常增加一些计数变量。类似的需求,我们有必要规范缓存方案。

根据StackOverflow的回答,有几个备选方案:

  1. 标准库functoolslru_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.

  1. 不过有基于它直接实现的库,比如cachetools

  2. beaker: 这是一个用在Web应用的缓存框架。

  3. pymemcache也是一个比较主流的方案。

  4. cachesql: SQL缓存。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions