al8n / stretto

Stretto is a Rust implementation for Dgraph's ristretto (https://github.com/dgraph-io/ristretto). A high performance memory-bound Rust cache.
Apache License 2.0
412 stars 28 forks source link

Heap optimization for removing min sample #6

Closed palashahuja closed 2 years ago

palashahuja commented 2 years ago

Currently, there was a TODO for finding the sample with min_hits, which is currently done by iterating through the samples. This PR optimizes by using a binary heap.

al8n commented 2 years ago

Thanks, @palashahuja!