Crate size_lru

Crate size_lru 

Source
Expand description

Size-aware cache library with multiple implementations

This library provides a common trait for size-aware caches with different eviction strategies.

§Features

  • lhd: LHD (Least Hit Density) cache implementation
  • no: NoCache - zero overhead no-op

大小感知缓存库,支持多种实现

本库为大小感知缓存提供通用 trait,支持不同的淘汰策略。

§特性

Structs§

Lhdlhd
淘汰采样热元数据(SoA 布局) 冷载荷 年龄桶统计 LHD cache with random sampling eviction
NoCacheno
No-op cache 空操作缓存
NoOnRm
No-op callback (zero overhead)

Traits§

OnRm
Callback on entry removal/eviction Called before actual removal or eviction, use cache.peek(key) to get value
SizeLru
Size-aware cache trait