From 8da7c9884219aa9bd351463c0d5f624ce460c6bb Mon Sep 17 00:00:00 2001 From: abbycin Date: Mon, 9 Mar 2026 08:18:10 +0800 Subject: [PATCH] Simplify baseline benchmark defaults --- README.md | 2 ++ docs/repro.md | 3 +-- scripts/mace.sh | 4 ++-- scripts/rocksdb.sh | 4 ++-- scripts/thread_points.sh | 21 ++++++--------------- 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f1dc6de..4a50d25 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ cd "$HOME/kv_bench" 3. Run baseline comparison (both engines append to the same CSV): +Default quick-baseline timing in these scripts is `WARMUP_SECS=3` and `MEASURE_SECS=5`. + ```bash rm -rf "${KV_BENCH_STORAGE_ROOT}/basic_mace" "${KV_BENCH_STORAGE_ROOT}/basic_rocks" mkdir -p "${KV_BENCH_STORAGE_ROOT}/basic_mace" "${KV_BENCH_STORAGE_ROOT}/basic_rocks" diff --git a/docs/repro.md b/docs/repro.md index 073288b..26f02e4 100644 --- a/docs/repro.md +++ b/docs/repro.md @@ -75,8 +75,7 @@ Generate plots: ## 5. Phase Reproduction Default thread points now follow host CPU count: -- If CPU count is a power of two: `1 2 4 ... N` (e.g., `4 -> 1 2 4`, `8 -> 1 2 4 8`, `16 -> 1 2 4 8 16`) -- Otherwise: odd-number progression up to near-full CPU usage (e.g., `12 -> 1 3 5 7 9 11`) +- Always use powers of two up to the largest point not exceeding host CPU count (e.g., `4 -> 1 2 4`, `8 -> 1 2 4 8`, `12 -> 1 2 4 8`, `16 -> 1 2 4 8 16`) You can still override via `PHASE1_THREADS` / `PHASE2_THREADS_TIER_M` / `PHASE3_THREADS`. diff --git a/scripts/mace.sh b/scripts/mace.sh index 174dbf2..71ad7ca 100755 --- a/scripts/mace.sh +++ b/scripts/mace.sh @@ -16,8 +16,8 @@ root_dir="$(cd -- "${script_dir}/.." && pwd)" db_root="$1" result_file="${2:-${script_dir}/benchmark_results.csv}" -warmup_secs="${WARMUP_SECS:-10}" -measure_secs="${MEASURE_SECS:-20}" +warmup_secs="${WARMUP_SECS:-3}" +measure_secs="${MEASURE_SECS:-5}" prefill_keys="${PREFILL_KEYS:-200000}" read_path="${READ_PATH:-snapshot}" diff --git a/scripts/rocksdb.sh b/scripts/rocksdb.sh index f436b17..7288500 100755 --- a/scripts/rocksdb.sh +++ b/scripts/rocksdb.sh @@ -16,8 +16,8 @@ rocksdb_dir="${root_dir}/rocksdb" db_root="$1" result_file="${2:-${script_dir}/benchmark_results.csv}" -warmup_secs="${WARMUP_SECS:-10}" -measure_secs="${MEASURE_SECS:-20}" +warmup_secs="${WARMUP_SECS:-3}" +measure_secs="${MEASURE_SECS:-5}" prefill_keys="${PREFILL_KEYS:-200000}" read_path="${READ_PATH:-snapshot}" diff --git a/scripts/thread_points.sh b/scripts/thread_points.sh index 7b24851..033a08e 100644 --- a/scripts/thread_points.sh +++ b/scripts/thread_points.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Shared helpers for choosing default thread points from host CPU count. +# Shared helpers for choosing default power-of-two thread points from host CPU count. detect_logical_cpus() { local detected @@ -28,21 +28,12 @@ is_power_of_two() { default_thread_points() { local cpu_count="${1:-$(detect_logical_cpus)}" local points=() - local t + local t=1 - if is_power_of_two "${cpu_count}"; then - t=1 - while [ "${t}" -le "${cpu_count}" ]; do - points+=("${t}") - t=$((t * 2)) - done - else - t=1 - while [ "${t}" -le "${cpu_count}" ]; do - points+=("${t}") - t=$((t + 2)) - done - fi + while [ "${t}" -le "${cpu_count}" ]; do + points+=("${t}") + t=$((t * 2)) + done printf "%s\n" "${points[*]}" }