This folder contains a reproducible benchmarking workflow that compares RESPOND v1 and v2 in R/Quarto.
scripts/run_v2_benchmark_grid.sh: Runs the v2 C++ benchmark over a sample-size grid and writesdata/v2_runtime.csv.scripts/prepare_benchmark_data.R: Combines v1 and v2 runtime CSV files intodata/combined_runtime.csv.benchmark_report.qmd: Quarto report with:- A direct v1 vs v2 comparison table.
- A runtime-over-sample-size line plot.
Both data/v1_runtime.csv and data/v2_runtime.csv must contain:
modelsample_sizemean_msp50_msp95_msmin_msmax_msstd_msns_per_stepchecksum
uv sync
bash scripts/run_v2_benchmark_grid.shuv run python scripts/build_v2_e2e_inputs.py
DB_PATH=/path/to/input.db \
CONF_PATH=/path/to/config.conf \
uv run python scripts/run_v2_e2e_benchmark.pyThe input builder creates default fixtures at:
data/v2_e2e_input.dbdata/v2_e2e_input.conf
So a typical run is:
uv run python scripts/build_v2_e2e_inputs.py
DB_PATH=data/v2_e2e_input.db CONF_PATH=data/v2_e2e_input.conf uv run python scripts/run_v2_e2e_benchmark.pyThis Python benchmark uses the local editable ../respondpy checkout, so it
tests the currently selected local respondpy branch. The v1 benchmark remains
managed separately and is not installed by this project.
For trustworthiness, this v2 e2e benchmark enforces strict parity with the v1 state-space dimensions used in this repo:
N_INTERVENTIONS=13N_BEHAVIORS=4STRICT_PARITY=1
This benchmark measures workflow throughput by timing each v2 run at process scope (process launch to process exit), while still emitting diagnostic load/run/write phase rows.
v2 benchmark state sizing is derived from decomposed dimensions:
N_INTERVENTIONS(default13)N_AGE(default1)N_GENDER(default1)N_OUD(default4)STRICT_PARITY(default1, enforces13 x 1 x 1 x 4)
Derived benchmark state size is:
state_size = N_INTERVENTIONS * N_AGE * N_GENDER * N_OUD
Example override (only if parity enforcement is disabled):
STRICT_PARITY=0 N_INTERVENTIONS=13 N_AGE=2 N_GENDER=2 N_OUD=4 bash scripts/run_v2_benchmark_grid.shRscript scripts/prepare_benchmark_data.Rquarto render benchmark_report.qmd- v2 benchmark sample size maps to
--samplesinrespond_benchmark. - v1 runtime CSV should be produced using an equivalent benchmark procedure over the same sample-size grid to enable valid direct comparison.