Skip to content

chore: extend path performance baselines#48

Merged
hyfdev merged 5 commits into
mainfrom
agent/safe-path-hot-path-baselines
Jul 13, 2026
Merged

chore: extend path performance baselines#48
hyfdev merged 5 commits into
mainfrom
agent/safe-path-hot-path-baselines

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • add separate normalization rows for early and late dirty markers around valid and invalid native encoding
  • add absolute invalid-encoding and direct string-receiver relative rows
  • require new timed benchmarks to land in a behavior-neutral baseline PR before their implementation PR

Why

This PR establishes stable CodSpeed benchmark identities before any implementation change. Draft #47 will use this branch as its base so each new case has both BASE and HEAD data instead of appearing only as new.

Validation

  • cargo fmt --all --check
  • cargo bench --locked --no-run

@codspeed-hq

codspeed-hq Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 210 untouched benchmarks
🆕 18 new benchmarks
⏩ 36 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
🆕 Simulation dirty_early N/A 2.9 µs N/A
🆕 Simulation dirty_late N/A 3.1 µs N/A
🆕 Simulation module_to_cwd N/A 2.1 µs N/A
🆕 Simulation dirty_before_non_utf8 N/A 2.5 µs N/A
🆕 Simulation non_utf8_before_dirty_late N/A 2.7 µs N/A
🆕 Simulation non_utf8_absolute_target N/A 8.4 µs N/A
🆕 Simulation non_utf8_lexically_clean N/A 2.5 µs N/A
🆕 Simulation borrowed_native/non_utf8_lossy N/A 2.3 µs N/A
🆕 Simulation borrowed_receiver/non_utf8_strict N/A 441.1 ns N/A
🆕 Memory dirty_early N/A 70 B N/A
🆕 Memory dirty_late N/A 70 B N/A
🆕 Memory module_to_cwd N/A 0 B N/A
🆕 Memory dirty_before_non_utf8 N/A 68 B N/A
🆕 Memory non_utf8_before_dirty_late N/A 81 B N/A
🆕 Memory non_utf8_absolute_target N/A 149 B N/A
🆕 Memory non_utf8_lexically_clean N/A 66 B N/A
🆕 Memory borrowed_native/non_utf8_lossy N/A 132 B N/A
🆕 Memory borrowed_receiver/non_utf8_strict N/A 0 B N/A

Comparing agent/safe-path-hot-path-baselines (3bd4208) with main (7599911)

Open in CodSpeed

Footnotes

  1. 36 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@hyfdev hyfdev force-pushed the agent/safe-path-hot-path-baselines branch from c76bdbb to d2ed128 Compare July 13, 2026 06:04
@hyfdev hyfdev force-pushed the agent/safe-path-hot-path-baselines branch from d2ed128 to 500497a Compare July 13, 2026 06:07
@hyfdev hyfdev marked this pull request as ready for review July 13, 2026 07:30
Copilot AI review requested due to automatic review settings July 13, 2026 07:30
@hyfdev hyfdev merged commit 5f4a1bd into main Jul 13, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends SugarPath’s performance baseline suite by introducing new, stable Criterion/CodSpeed benchmark identities (notably for non-UTF-8/native-encoding and “dirty marker position” cases) and by documenting a baseline-first protocol so future optimization PRs (e.g., #47) can get BASE vs HEAD deltas instead of “new benchmark” rows.

Changes:

  • Add a dedicated hot_path_baselines benchmark binary to isolate new baseline families under fat LTO.
  • Rename/reshape existing non-UTF-8 benchmark groups/leaf names to keep non_utf8 visible at the leaf level.
  • Update benchmarking and project performance-strategy documentation to codify baseline protocol and non-UTF-8 performance scope.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Cargo.toml Registers the new hot_path_baselines Criterion benchmark binary.
benchmarks/README.md Documents non-UTF-8 naming visibility and the “baseline PR before implementation PR” workflow.
benches/to_slash.rs Renames the non-UTF-8 to-slash benchmark group/IDs to be more explicit.
benches/normalize.rs Renames the non-UTF-8 normalize benchmark group/ID to a non_utf8-explicit identity.
benches/hot_path_baselines.rs Adds new benchmark rows for classifier-position, non-UTF-8 normalization variants, and additional relative baselines.
.agents/docs/README.md Updates the PCR map to point optimization/non-UTF-8 tradeoff discussions to performance-strategy guidance.
.agents/docs/performance-strategy.md Adds/expands the documented performance strategy and baseline protocol rationale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +57 to +63
let base = Path::new(ROLLDOWN_ROOT);
let mut group = criterion.benchmark_group("relative/slow_path");
group
.throughput(Throughput::Bytes((non_utf8.as_os_str().len() + base.as_os_str().len()) as u64));
group.bench_function("non_utf8_absolute_target", |bencher| {
bencher.iter(|| black_box(non_utf8.as_path()).relative(black_box(base)));
});
Comment on lines +71 to +74
group.throughput(Throughput::Bytes((case.target.len() + case.base.len()) as u64));
group.bench_function(case.name, |bencher| {
bencher.iter(|| black_box(black_box(case.target).relative(black_box(case.base))));
});
Comment thread benches/to_slash.rs
Comment on lines +94 to 100
group.throughput(Throughput::Bytes(non_utf8.as_os_str().len() as u64));
group.bench_function("borrowed_receiver/non_utf8_strict", |bencher| {
bencher.iter(|| black_box(black_box(non_utf8.as_path()).try_to_slash()));
});
group.bench_function("borrowed_receiver/lossy_result", |bencher| {
bencher.iter(|| black_box(black_box(invalid.as_path()).to_slash_lossy()));
group.bench_function("borrowed_native/non_utf8_lossy", |bencher| {
bencher.iter(|| black_box(black_box(non_utf8.as_path()).to_slash_lossy()));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants