Simplify baseline benchmark defaults

This commit is contained in:
abbycin 2026-03-09 08:18:10 +08:00
parent 2c33c45d2c
commit 8da7c98842
5 changed files with 13 additions and 21 deletions

View File

@ -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"

View File

@ -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`.

View File

@ -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}"

View File

@ -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}"

View File

@ -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[*]}"
}