memory-benchmark

Installation
SKILL.md

Memory Benchmarking & Analysis

perf/memory benchmarks memory use of SQL workloads in WAL and MVCC journal modes. It uses dhat as the global allocator (every heap allocation) and memory-stats for RSS. Each run writes dhat-heap.json to the current directory.

  • Crate: perf/memory/ (docs: perf/memory/README.md)
  • CodSpeed bench crate: perf/memory/codspeed/ (allocation tracking in CI)
  • dhat analysis: perf/memory/analyze-dhat.py (--help lists sort metrics and flags)

Use --release for byte and peak comparisons. Debug builds are fine for checking that a workload runs. Randomized profiles (read-heavy, mixed) use a fixed RNG seed, so workloads repeat across runs.

Running a Workload

cargo run --release -p memory-benchmark -- --mode wal --workload insert-heavy -i 100 -b 100
cargo run --release -p memory-benchmark -- --mode mvcc --workload mixed -i 100 -b 100 --connections 4

Run --help for all flags (--checkpoint, --cache-size, --format, and others). Workloads: insert-heavy, read-heavy, mixed, scan-heavy, recursive-cte, series-blob, update-churn. update-churn creates superseded row versions, which is the MVCC GC case.

Installs
62
GitHub Stars
25.3K
First Seen
Apr 5, 2026