Skip to content

chore: add unit test to validate benchmark code#72

Merged
nyurik merged 5 commits intofast-pack:mainfrom
nyurik:benches
Mar 18, 2026
Merged

chore: add unit test to validate benchmark code#72
nyurik merged 5 commits intofast-pack:mainfrom
nyurik:benches

Conversation

@nyurik
Copy link
Copy Markdown
Member

@nyurik nyurik commented Mar 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 18, 2026 01:52

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 refactors the Criterion benchmark suite to share data generators/fixtures via a new benches/bench_utils.rs module, and adds a smoke-test suite so benchmark code paths are exercised by cargo test (useful for coverage without Criterion overhead).

Changes:

  • Added benches/bench_utils.rs with shared generators, codec helpers, and precomputed fixtures.
  • Refactored benches/fastpfor_benchmark.rs to consume those fixtures instead of duplicating logic.
  • Added tests/benchmark_smoke.rs to run each benchmark path once under cargo test, and updated Cargo.toml bench configuration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/benchmark_smoke.rs New smoke tests that run benchmark helper paths once for coverage.
benches/bench_utils.rs New shared module providing generators, helpers, and fixtures for benches/tests.
benches/fastpfor_benchmark.rs Benchmarks now use shared fixtures; roundtrip and cpp-vs-rust paths updated accordingly.
Cargo.toml Adds an additional bench target entry related to bench_utils.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Cargo.toml
Comment on lines 76 to 83
@@ -252,48 +82,32 @@ fn benchmark_roundtrip(c: &mut Criterion) {
&mut output_offset,
)
@nyurik nyurik merged commit 88ba2d4 into fast-pack:main Mar 18, 2026
15 checks passed
@nyurik nyurik deleted the benches branch March 18, 2026 02:17
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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