Skip to content

feat(library-selection): #205 Phase 7 perf benchmarks (P-02, P-03)#210

Merged
zackees merged 1 commit intomainfrom
feat/205-phase-7-perf-bench
Apr 25, 2026
Merged

feat(library-selection): #205 Phase 7 perf benchmarks (P-02, P-03)#210
zackees merged 1 commit intomainfrom
feat/205-phase-7-perf-bench

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 25, 2026

Adds the two `criterion` benchmarks from #205 Phase 7 that don't depend on Phase 4 cache.

What ships

  • `fbuild-header-scan/benches/scan_throughput.rs` — measures `scan()` MB/s on tiny/medium/large adversary fixtures (raw strings, comments, identifiers ending in `R`/`L`). Target per P-03: ≥ 50 MB/s single-thread.
  • `fbuild-library-select/benches/resolve_cold.rs` — end-to-end `resolve()` on a synthetic 30-library framework tree with a 5-level transitive chain. Target per P-02: ≤ 200 ms cold. Uses `MiniFramework` so the bench is hermetic — no real Teensyduino install required.
  • Adds workspace `criterion = "0.5"` dev-dep.

Out of scope (still tracked)

  • P-01 (warm matrix) and P-04 (cache-hit round-trip) — both depend on Phase 4 cache, gated on zackees/zccache#130.
  • CI gating against captured thresholds — follow-up once runner variance is characterized.

Run

```bash
uv run soldr cargo bench -p fbuild-header-scan --bench scan_throughput
uv run soldr cargo bench -p fbuild-library-select --bench resolve_cold
```

Verification

Gate Result
`cargo build --release --benches` (both crates) green
`cargo clippy --workspace --all-targets -- -D warnings` green
`cargo fmt --all --check` clean

Refs: #202, #204, #205, zackees/zccache#130

🤖 Generated with Claude Code

Adds two `criterion` benchmarks that capture baseline numbers for
issue #205's Phase 7 perf gates. This PR lands the harness; CI
gating against thresholds is a follow-up once we have a stable
measurement on a known runner spec.

## Benchmarks

- `crates/fbuild-header-scan/benches/scan_throughput.rs`
  Measures `scan()` throughput on three input sizes (tiny/medium/large)
  with adversary fixtures (raw strings, comments, identifiers ending
  in `R`/`L`, char literals). Target per #205 P-03: >= 50 MB/s
  single-thread.

- `crates/fbuild-library-select/benches/resolve_cold.rs`
  End-to-end `resolve()` walk on a synthetic 30-library framework
  tree with a 5-level transitive include chain. Target per #205 P-02:
  <= 200 ms cold for a typical teensy41 project. Uses
  `MiniFramework` from `fbuild-test-support` so the bench is hermetic.

Both use `harness = false` and depend on the new workspace
`criterion = "0.5"` dev-dep. Run with:

```bash
uv run soldr cargo bench -p fbuild-header-scan --bench scan_throughput
uv run soldr cargo bench -p fbuild-library-select --bench resolve_cold
```

## Out of scope (still tracked)

- P-01 (warm matrix) — gated on Phase 4 cache (zccache#130).
- P-04 (cache-hit round-trip) — same.
- CI gating against the captured thresholds — follow-up once runner
  variance is characterized.

## Verification

- `uv run soldr cargo build --release -p fbuild-header-scan -p fbuild-library-select --benches` — green.
- `uv run soldr cargo clippy --workspace --all-targets -- -D warnings` — green.
- `uv run soldr cargo fmt --all --check` — clean.

Refs: #205, #202, #204

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 7 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 7 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c1315fb5-51fc-43d0-8172-6e687848fc39

📥 Commits

Reviewing files that changed from the base of the PR and between a28ead6 and 7dfa222.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • Cargo.toml
  • crates/fbuild-header-scan/Cargo.toml
  • crates/fbuild-header-scan/benches/README.md
  • crates/fbuild-header-scan/benches/scan_throughput.rs
  • crates/fbuild-library-select/Cargo.toml
  • crates/fbuild-library-select/benches/README.md
  • crates/fbuild-library-select/benches/resolve_cold.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/205-phase-7-perf-bench

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees zackees merged commit 0bf4b2f into main Apr 25, 2026
78 of 79 checks passed
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.

1 participant