Repository navigation
docs(bench): replace --skip with positional FILTER - #2547
Merged
Merged
Conversation
Criterion 0.8 (the maintained criterion-rs fork — already the latest) has no `--skip` flag; only positional substring `[FILTER]` and `--exact`. Four invocations across `benches/CLAUDE.md` and the `benches/alias.rs` header comment used `--skip`, which fails with "unexpected argument '--skip' found". Rewritten to use positional filters with concrete worked examples, plus a one-line note explaining there's no exclusion flag and that benchmark IDs follow `<group>/<label>/<param>`. Verified `cargo bench --bench alias dispatch/warm -- --measurement-time 5 --sample-size 10` runs exactly the two stub-warm variants. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
May 3, 2026
5 of 6 tasks
max-sixty
added a commit
that referenced
this pull request
May 3, 2026
- `run_timeline`'s leading doc-comment still said `WORKTRUNK_TRACE=1` even though the body sets `RUST_LOG=debug`. Update it to match. - `benches/list.rs` header still showed `cargo bench --bench list -- --skip cold` / `--skip real` examples — the same syntax #2547 removed from the docs. Replace with the positional-FILTER form so the bench file's examples agree with `benches/CLAUDE.md` and the root `CLAUDE.md` Benchmarks section. Co-Authored-By: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
May 3, 2026
## Summary Adds `wt-perf timeline` to standardize how we capture and read traces for one-off `wt` invocations (alias dispatch, `wt list`, etc.). Replaces the prior `RUST_LOG=debug wt … 2>&1 | wt-perf trace > trace.json` dance with a single command that runs `wt`, captures stderr, parses `[wt-trace]` records, and either pretty-prints a sorted text timeline or emits Chrome Trace Format JSON for Perfetto. The text mode is the path I expect to use most — it's a column-aligned table sorted by start time, with subprocess totals and an externally-measured wall (`spawn → wait`) so the unobserved prelude/epilogue is visible: ``` ts(ms) dur tid kind name 0.000 11µs 1 span init_logging 0.043 3.979ms 1 span prewarm 0.058 3.882ms 1 cmd git rev-parse --git-common-dir … HEAD [wt-perf-typical-1] … 3 subprocesses totaling 11.315ms (slowest: 3.882ms git rev-parse … HEAD) traced: 14.838ms (first → last [wt-trace] record) wall: 19.367ms (spawn → wait; +4.529ms untraced prelude/epilogue) ``` ## What's in the diff - **`tests/helpers/wt-perf/src/main.rs`** — new `Timeline` subcommand. Resolves `wt` as a sibling of `current_exe()` (Windows-aware via `EXE_SUFFIX`), optionally invalidates caches with `--cold [--repo PATH]`, runs `wt` with `RUST_LOG=debug`, captures stderr, and renders. Uses `tabwriter` for column alignment, `Duration`'s std `Debug` for compact unit display, and `insta` for inline snapshot tests. - **`tests/helpers/wt-perf/Cargo.toml`** — new deps: `tabwriter` (release), `insta` (dev). - **`CLAUDE.md`** — fixes stale `--skip` syntax in the Benchmarks section (Criterion takes a positional FILTER, per #2547), replaces the non-existent `bench_list_by_worktree_count` example, adds a Traces section. - **`benches/CLAUDE.md`** — leads "Generating traces" with `wt-perf timeline`; the manual stderr-redirect pipeline is now framed as the path for traces from a log already on disk. - **`src/trace/mod.rs`** module doc — same usage block update so library doc and CLAUDE.md don't drift. - **`wt-perf setup`** printed suggestion — hints at `wt-perf timeline` instead of the manual stderr redirect. `wt-perf trace` (stdin/file → Chrome JSON) and `wt-perf cache-check` are unchanged — they still serve the case where you have a captured log and want to convert or analyze it without re-running. ## Test plan - [x] `cargo run -- hook pre-merge --yes` (3432 tests, lints, doctests) passes locally - [x] `wt-perf timeline -- -C \$REPO stub` end-to-end on a typical-1 fixture - [x] `wt-perf timeline --cold --repo \$REPO -- -C \$REPO stub` invalidates and reruns - [x] `wt-perf timeline --chrome -- -C \$REPO stub` produces valid JSON (loaded into `python -m json.tool`) - [x] `cargo test -p wt-perf --bin wt-perf` — 2 inline insta snapshots pass - [ ] CI green 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Criterion 0.8 (the maintained criterion-rs fork — already the latest) has no
--skipflag; only positional substring[FILTER]and--exact. Four invocations inbenches/CLAUDE.mdand thebenches/alias.rsheader comment used--skip, which fails withunexpected argument '--skip' found.Rewritten to use positional filters with concrete worked examples, plus a short note that Criterion has no exclusion flag and that benchmark IDs follow
<group>/<label>/<param>. For the alias bench,dispatch/warmanddispatch/coldreplace the previous--skip cold/--skip with_varsexamples.Verified
cargo bench --bench alias dispatch/warm -- --measurement-time 5 --sample-size 10runs exactly the two stub-warm variants.