高性能 Python 内存缓存: Theine

2023-02-10 12:21:50 +08:00
 matrix1010

前段时间开源了 Python 的异步缓存框架 Cacheme ,现在把其中的内存缓存部分单独抽出来作为一个 library ,有兴趣的可以试用一下.

Theine: https://github.com/Yiling-J/theine

Benchmarks: https://github.com/Yiling-J/cacheme-benchmark

类似于Caffeine(Java)/Ristretto(Go)/Moka(Rust),具有以下特点:

2639 次点击
所在节点    Python
4 条回复
Nazz
2023-02-10 13:16:51 +08:00
我也写过一个内存缓存库,使用 hashmap 和 heap 实现 ttl
matrix1010
2023-02-10 13:36:44 +08:00
@Nazz heap 也可以,似乎 Go 自带的 timer 就是通过 heap 实现的
matrix1010
2023-02-10 21:21:59 +08:00
有兴趣的也可以看看我在 reddit 上发的这个帖子: https://www.reddit.com/r/Python/comments/10xnpjh/python_deserves_a_good_inmemory_cache_library/
mongodb
2023-02-15 17:25:19 +08:00
很好,不用啥都塞 redis 了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/914855

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX