size_lru 0.1.32

Fastest size-aware LRU cache with highest hit rate via LHD algorithm / 最快的大小感知 LRU 缓存,基于 LHD 算法实现最高命中率
Documentation
{
  "config": {
    "mem_budget": 67108864,
    "read_ratio": 90,
    "write_ratio": 9,
    "delete_ratio": 1,
    "real_miss_ratio": 5,
    "zipf_s": 1.0,
    "ops_per_loop": 0,
    "loops": 0
  },
  "miss_latency_ns": 18000,
  "miss_latency_method": "DapuStor X5900 PCIe 5.0 NVMe (18µs)",
  "stats": {
    "total_size_bytes": 187207490,
    "item_count": 20000,
    "avg_item_size": 9360,
    "min_item_size": 66,
    "max_item_size": 621189,
    "mem_budget": 67108864,
    "size_distribution": [
      {
        "label": "<100B",
        "count": 7999,
        "percent": 39.995000000000005,
        "total_size_bytes": 560358,
        "size_percent": 0.29932456228113524
      },
      {
        "label": "100B-1KB",
        "count": 7000,
        "percent": 35.0,
        "total_size_bytes": 4111222,
        "size_percent": 2.1960777317189604
      },
      {
        "label": "1-10KB",
        "count": 4000,
        "percent": 20.0,
        "total_size_bytes": 22423388,
        "size_percent": 11.977826314534743
      },
      {
        "label": "10-100KB",
        "count": 801,
        "percent": 4.005,
        "total_size_bytes": 44957154,
        "size_percent": 24.014612876867268
      },
      {
        "label": ">=100KB",
        "count": 200,
        "percent": 1.0,
        "total_size_bytes": 115155368,
        "size_percent": 61.51215851459789
      }
    ]
  },
  "results": [
    {
      "lib": "size_lru",
      "hit_rate": 0.7507720678086605,
      "ops_per_second": 677260.524792791,
      "effective_ops": 167710.96231438723,
      "memory_mb": 64.39977264404297,
      "capacity": 55877819,
      "scale_factor": 0.9968140623776428
    },
    {
      "lib": "schnellru",
      "hit_rate": 0.44188939989779824,
      "ops_per_second": 1019027.7965307198,
      "effective_ops": 90683.87912890616,
      "memory_mb": 64.04366302490234,
      "capacity": 702,
      "scale_factor": 1.0
    },
    {
      "lib": "lru",
      "hit_rate": 0.43552400630984917,
      "ops_per_second": 945041.8831222098,
      "effective_ops": 89136.71235119578,
      "memory_mb": 64.15157318115234,
      "capacity": 664,
      "scale_factor": 1.0
    },
    {
      "lib": "hashlink",
      "hit_rate": 0.43296896176320293,
      "ops_per_second": 962775.0998669763,
      "effective_ops": 88926.65024110723,
      "memory_mb": 66.80400848388672,
      "capacity": 678,
      "scale_factor": 1.0
    },
    {
      "lib": "clru",
      "hit_rate": 0.41341731653669267,
      "ops_per_second": 911852.3711011187,
      "effective_ops": 85798.92965056791,
      "memory_mb": 63.77764129638672,
      "capacity": 55050267,
      "scale_factor": 1.0
    },
    {
      "lib": "moka",
      "hit_rate": 0.6007354084738608,
      "ops_per_second": 186892.43896268157,
      "effective_ops": 79761.13837790645,
      "memory_mb": 63.98762512207031,
      "capacity": 52824664,
      "scale_factor": 1.0
    },
    {
      "lib": "mini-moka",
      "hit_rate": 0.5815059210380146,
      "ops_per_second": 186195.6988964855,
      "effective_ops": 77497.83207549287,
      "memory_mb": 63.989234924316406,
      "capacity": 55855206,
      "scale_factor": 1.0
    }
  ]
}