Skip to content

Commit 7d82e76

Browse files
committed
Fixed
1 parent e07f0ff commit 7d82e76

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
### Fixed
1414
- Disabled-path `benchmark!` macro parse error under `collector`-only builds (no `benchmark`): corrected macro expansion to use `$($body)*` in disabled arms.
1515
- Clippy warnings in `src/trace.rs` (`inline_always`, `uninlined_format_args`): replaced with `#[inline]` and inline format args.
16+
- Perf CI: baseline comparison script now supports both Criterion layouts (`target/criterion/<bench_name>/...` and flat `target/criterion/...`); fixes "criterion group directory not found" error in `.github/workflows/perf.yml`.
1617

1718
### Maintenance
1819
- Bench workflow `.github/workflows/bench.yml`: use `examples/zero_overhead.rs` for the no-default-features run, and keep `overhead_compare` for the enabled run to avoid feature gating conflicts.

scripts/compare_criterion_baseline.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ if [[ ! -f "${BASELINE_JSON}" ]]; then
2424
exit 2
2525
fi
2626

27-
BASE_DIR="target/criterion/${GROUP_NAME}"
28-
if [[ ! -d "${BASE_DIR}" ]]; then
29-
echo "error: criterion group directory not found: ${BASE_DIR}" >&2
27+
# Determine base directory: support both nested and flat criterion layouts
28+
# 1) Nested: target/criterion/<GROUP_NAME>/<KEY>/new/estimates.json
29+
# 2) Flat: target/criterion/<KEY>/new/estimates.json
30+
if [[ -d "target/criterion/${GROUP_NAME}" ]]; then
31+
BASE_DIR="target/criterion/${GROUP_NAME}"
32+
elif [[ -d "target/criterion" ]]; then
33+
BASE_DIR="target/criterion"
34+
else
35+
echo "error: criterion directory not found: target/criterion" >&2
3036
exit 2
3137
fi
3238

39+
# Optional: show which layout is used (useful in CI logs)
40+
echo "Using Criterion base directory: ${BASE_DIR}" >&2
41+
3342
fail_count=0
3443

3544
# Iterate baseline entries: key, median_s, tolerance

0 commit comments

Comments
 (0)