Skip to content

Release v6.2.9

Choose a tag to compare

@awolverp awolverp released this 29 Oct 08:30
· 31 commits to main since this release

This is a patch release focused on performance and correctness.

What's Changed

  • RRCache random eviction is now expected O(1). popitem() and random_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 large VTTLCache is dramatically faster. Also fixes a bug where LFUCache.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

Full Changelog: v6.2.8...v6.2.9