cuckoo-cache 0.2.0

Cuckoo hash based cache storage engine with fixed-size item slots
Documentation

Cuckoo hash based cache storage engine with fixed-size item slots.

This crate implements an array-based cache that uses cuckoo hashing to map keys to one of D=4 candidate positions in a flat array of fixed-size slots. When all candidate positions for a new key are occupied, existing items may be displaced to their alternative positions, up to a configurable depth. If displacement fails, an item is evicted according to the configured policy.

The design is based on the cuckoo storage engine from Pelikan: https://github.com/pelikan-io/pelikan

Goals:

  • O(1) lookup with bounded worst case
  • fixed per-item memory overhead
  • bounded insertion latency via displacement limits

Non-goals:

  • not designed for concurrent access
  • not suited for items larger than the configured slot size