argscape benchmark#
Benchmark ARGscape inference and visualization performance.
Note
This command requires argscape[spatial]. If you only have the base package, install the spatial extras first:
pip install argscape[spatial]
Synopsis#
argscape benchmark --version
argscape benchmark run [options...]
argscape benchmark generate-datasets [options...]
argscape benchmark report [options...]
Description#
The argscape benchmark command provides tools for measuring the performance of ARGscape’s inference algorithms and visualization rendering. It can generate standardized benchmark datasets, run timed benchmarks, and produce reports with performance metrics.
This is useful for:
Comparing inference method performance across different dataset sizes
Measuring visualization rendering times
Generating reproducible benchmark results for publications
Identifying performance regressions
Global Options#
--versionDisplay the ARGscape version number and exit.
Subcommands#
run#
Run benchmarks on inference methods and/or visualization.
argscape benchmark run [options...]
Options#
-o, --output DIROutput directory for benchmark results. Default:
results.-d, --datasets DIRDirectory containing benchmark datasets. If not specified, uses generated datasets.
-m, --methods METHODSComma-separated list of inference method names to benchmark. If not specified, benchmarks all available methods.
--inference-onlyOnly run inference benchmarks (skip visualization benchmarks).
--visualization-onlyOnly run visualization benchmarks (skip inference benchmarks).
-r, --repetitions NNumber of repetitions for each benchmark to ensure timing stability. Default:
3.--timeout SECONDSTimeout per inference run in seconds. Default:
600(10 minutes).--show-browserShow browser window during visualization benchmarks (default is headless mode).
--server-url URLURL of a running ARGscape server. Default:
http://localhost:8000. The server must be started separately before running visualization benchmarks.--resumeResume from a previous run, only re-running benchmarks that failed or timed out.
-q, --quietSuppress progress output.
--debugEnable debug output from subprocesses.
generate-datasets#
Generate standardized benchmark datasets using msprime simulations.
argscape benchmark generate-datasets [options...]
Options#
-o, --output DIROutput directory for generated datasets. Default:
datasets/simulated.--samples COUNTSComma-separated list of sample counts to generate. Default:
50,100,250,500.--sequence-lengths LENGTHSComma-separated list of sequence lengths to generate. Default:
1e5,1e6,1e7.--seed SEEDRandom seed for reproducibility. Default:
42.-q, --quietSuppress progress output.
report#
Generate reports from benchmark results.
argscape benchmark report [options...]
Options#
-r, --results DIRDirectory containing benchmark results. Default:
results.-f, --format FORMATOutput format for the report. Choices:
latex- LaTeX tables for publicationsplots- PNG/SVG performance plotsall- Generate both LaTeX and plots (default)
-q, --quietSuppress progress output.
Examples#
Generate benchmark datasets:
argscape benchmark generate-datasets --output ./datasets
Generate datasets with custom sample sizes:
argscape benchmark generate-datasets --samples 25,50,100,200 --seed 123
Run all benchmarks (requires server running):
# Terminal 1: Start the server
argscape serve --no-browser
# Terminal 2: Run benchmarks
argscape benchmark run --output ./results --datasets ./datasets
Run only inference benchmarks for specific methods:
argscape benchmark run --inference-only --methods midpoint,fastgaia --output ./results
Run benchmarks with more repetitions for stable timing:
argscape benchmark run --repetitions 10 --timeout 1200 --output ./results
Resume a failed benchmark run:
argscape benchmark run --resume --output ./results
Generate a LaTeX report from results:
argscape benchmark report --results ./results --format latex
Generate all report formats:
argscape benchmark report --results ./results --format all
Workflow#
A typical benchmarking workflow:
Generate datasets with standardized parameters:
argscape benchmark generate-datasets -o datasets
Start the ARGscape server (required for visualization benchmarks):
argscape serve --no-browser --no-tsdate
Run benchmarks in a separate terminal:
argscape benchmark run -d datasets -o results
Generate reports:
argscape benchmark report -r results -f all
Output Files#
Benchmark Results#
Results are saved in the output directory with:
inference_results.json- Timing data for inference methodsvisualization_results.json- Timing data for renderingIndividual timing files per dataset/method combination
Reports#
Generated reports include:
LaTeX tables with timing statistics
Performance scaling plots (time vs. sample count, sequence length)
Method comparison charts
Exit Codes#
0- Success1- Error (benchmark failed, missing dependencies)
Requirements#
Running ARGscape server for visualization benchmarks
msprime for dataset generation
Playwright for headless browser benchmarks (installed automatically)