Repository navigation
Release v6.2.9
This is a patch release focused on performance and correctness.
What's Changed
-
RRCache random eviction is now expected O(1).
popitem()andrandom_key()no longer walk the whole table. They probe a few random buckets and fall back only on sparse tables. Benchmarks show 10x-500x faster evicts (#115). -
Indexed binary heap for
LFUCache/VTTLCache. Replaces the old “re-sort the whole VecDeque on every eviction” approach with an indexed min-heap. Filling a largeVTTLCacheis dramatically faster. Also fixes a bug whereLFUCache.popitem()could evict a hot key after reads only (#112). -
Better hash distribution for hashbrown. Mixes Python hashes once (fold-multiply) so the 7-bit SIMD control tags are well distributed. Small ints and many floats previously all landed in tag 0, causing extra equality checks. Benchmarks show time dropped from ~200 ms to ~6 ms and
__eq__calls fell from ~4.5 M to ~9 k (#111). -
Iterator views now hold the cache lock while reading. Follow-up to the free-threaded iterator safety work. Every view method now takes the lock, checks the generation, and reads while still holding it (#116).
-
Iterator implementation optimization. Tighter checks, fewer clones.
-
Fix invalid DECREF on Py_None. This could panic on some builds/Python versions when the Bound was dropped (#113).
-
Bumped PyO3 from 0.29.3 to 0.30.1 (#105).
Special Thanks to
- @greenclaw for #111, #112, #115, and #116.
- @rvarnava for the expanded regression and model-based tests.
Full Changelog: v6.2.8...v6.2.9