Theine V2
https://github.com/Yiling-J/theine/tree/v2
https://github.com/Yiling-J/theine/pull/30
related branches: theine-core: https://github.com/Yiling-J/theine-core/tree/v2 theine: https://github.com/Yiling-J/theine/tree/v2
Changes(WIP):
- Remove policy param from Cache, there is only one policy
tlfunow. - Use sharded dict with lock for data storage.
- Striped read buffer.
- Use object
hash()instead of auto increasing key. - Rewrite Rust core, use
u64as key. - Use asyncio for proactively expire, now all cache instances will use same event loop for maintance task.
- The
lockparam of decorator will be removed, Theine will always use synchronization primitive to avoid thundering herd problem.
Related issues:
-
https://github.com/PyO3/pyo3/issues/4265#issuecomment-2318686408
I attempted to build without the GIL, and it seems to work. -
https://github.com/python/cpython/issues/123619
The instance method has high contention, making it slow. This should be fixed before running scalability benchmarks. -
https://github.com/Yiling-J/theine/pull/27
The refactor/rewrite is based on this PR, which should be merged first.