--- name: bench-performance description: Iterate on Vortex vx-bench query performance with benchmark comparisons, engine-specific benchmark flags, RUST_LOG/tracing/metrics/explain output, and Samply profiles. Use when optimizing or investigating a vx-bench query, benchmark regression, engine/format comparison, or Vortex benchmark hotspot. --- # Bench Performance ## Overview Use this skill for Vortex benchmark performance work driven by `vx-bench` or the direct benchmark binaries. Start with comparable benchmark evidence, then add diagnostics (`RUST_LOG`, explain, metrics, tracing), then profile with Samply when the slow target is clear. This skill complements `$samply`: use `$samply` for profile recording, Firefox-profiler JSON schema, symbolication, and stack summaries. This skill decides when to benchmark, what engine flags to use, what logs/metrics to collect, and how to iterate without losing the comparison. ## Reporting Cadence Emit evidence as soon as it exists: 1. When a benchmark run starts, say the suite/query/engine/format, iteration count, and env toggles. 2. When it finishes, immediately show the run ID or output path and the comparison/timing table. 3. When logs, metrics, explain output, or a Samply summary finishes, immediately summarize the top signal before reading more code. 4. Only then form a hotspot hypothesis and make one scoped change. Do not wait for a deep code read before showing benchmark comparisons or first stack summaries. ## Standard Loop 1. Capture branch and dirty state: ```bash git status --short git branch --show-current git diff --stat develop...HEAD ``` 2. Identify the exact benchmark target: - suite: `tpch`, `tpcds`, `clickbench`, `fineweb`, `gh-archive`, `polarsignals`, `public-bi`, or `statpopgen`; - query number(s), for example `-q `; - engine/format target(s), for example `datafusion:vortex` versus `datafusion:parquet`; - runtime environment toggles, if the branch exposes any. 3. Run a small comparable benchmark through `vx-bench`: ```bash FEATURE_TOGGLE=1 UV_CACHE_DIR=/private/tmp/vortex-uv-cache \ uv run --project bench-orchestrator vx-bench run \ -e \ -f , \ -q \ -i 3 \ -l