#load-generator #benchmark #zipf #performance

nightly load

Load generator for benchmark tasks with Zipf distribution

4 releases

Uses new Rust 2024

0.1.3 Aug 14, 2025
0.1.2 Aug 14, 2025
0.1.1 Aug 14, 2025
0.1.0 Aug 14, 2025

#391 in Profiling

MIT/Apache

85KB
350 lines

load

Crates.io docs.rs License Crates.io

Load generator for benchmark tasks with Zipf distribution.

Zipf distribution models real-world access patterns where a small number of items account for the majority of requests (hot data). This is common in web caches, database queries, and file system access patterns.

Usage

use load::zipf::Zipf;

// Generate cache access indices with Zipf distribution
let cache_accesses: Vec<usize> = Zipf::indices_access(1..1001, 1.2).unwrap()
    .take(10000)
    .collect();

// Generate raw Zipf values
let zipf = Zipf::new(1.0..100.0, 1.1).unwrap();
let value = zipf.sample(0.1);

Shape parameter s controls distribution steepness:

  • s = 1.0: Classical Zipf
  • s = 1.2: Typical web cache patterns
  • s = 2.0: Very steep (95/5 rule)

Dependencies

~350KB