Skip to content

add benchmark - #108

Merged
arvidn merged 1 commit into
mainfrom
benchmark
May 11, 2026
Merged

add benchmark#108
arvidn merged 1 commit into
mainfrom
benchmark

Conversation

@arvidn

@arvidn arvidn commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

This adds a benchmark for some of the key functions in PoS2. One quirk is that the benchmark won't create the test plot itself, it depends on running the regular unit tests first to do that.

get_qualities_for_challenge
                        time:   [4.8223 ms 4.8294 ms 4.8376 ms]
Found 8 outliers among 100 measurements (8.00%)
  1 (1.00%) low mild
  5 (5.00%) high mild
  2 (2.00%) high severe

solve_proof             time:   [15.855 ms 16.350 ms 16.897 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe

validate_proof_v2       time:   [7.4221 µs 7.5475 µs 7.7457 µs]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

quality_string_from_proof
                        time:   [1.2221 µs 1.2284 µs 1.2354 µs]
Found 18 outliers among 100 measurements (18.00%)
  13 (13.00%) high mild
  5 (5.00%) high severe

@socket-security

socket-security Bot commented Apr 15, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcriterion@​0.5.19810098100100

View full report

@socket-security

socket-security Bot commented Apr 15, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • anes@0.1.6
  • autocfg@1.5.0
  • cast@0.3.0
  • ciborium@0.2.2
  • ciborium-io@0.2.2
  • ciborium-ll@0.2.2
  • criterion@0.5.1
  • criterion-plot@0.5.0
  • crunchy@0.2.4
  • either@1.15.0
  • half@2.7.1
  • hermit-abi@0.5.2
  • is-terminal@0.4.17
  • itertools@0.10.5
  • itoa@1.0.18
  • num-traits@0.2.19
  • once_cell@1.21.4
  • oorandom@11.1.5
  • same-file@1.0.6
  • serde_json@1.0.149
  • tinytemplate@1.2.1
  • walkdir@2.5.0
  • winapi-util@0.1.11
  • zerocopy@0.8.48
  • zerocopy-derive@0.8.48
  • zmij@1.0.21

View full report

@arvidn

arvidn commented Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore-all

@arvidn
arvidn requested a review from drnick23 April 17, 2026 08:21

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

Adds Criterion benchmarking support for the chia-pos2 crate to measure performance of key PoS2/FFI-heavy APIs, plus CI coverage to ensure the benchmark targets continue to compile.

Changes:

  • Add a new Criterion benchmark (pos2_bench) that loads a pre-generated test plot and benchmarks core APIs.
  • Add criterion as a workspace dependency and a chia-pos2 dev-dependency, and register the bench target.
  • Add a GitHub Actions workflow that compiles the benchmark targets on Linux/macOS/Windows.

Reviewed changes

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

Show a summary per file
File Description
crates/chia-pos2/benches/pos2_bench.rs New Criterion benchmark with a fixture loader that depends on an existing temp-dir plot file.
crates/chia-pos2/Cargo.toml Adds criterion dev-dependency and declares the pos2_bench benchmark target.
Cargo.toml Adds criterion to [workspace.dependencies] for version unification across crates.
Cargo.lock Locks newly introduced Criterion transitive dependencies.
.github/workflows/bench-build.yaml New CI job to compile (not run) chia-pos2 benches on multiple OSes.

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

Comment thread crates/chia-pos2/benches/pos2_bench.rs
Comment thread crates/chia-pos2/benches/pos2_bench.rs
Comment thread crates/chia-pos2/benches/pos2_bench.rs
@arvidn
arvidn merged commit 1c91cf1 into main May 11, 2026
43 checks passed
@arvidn
arvidn deleted the benchmark branch May 11, 2026 17:56
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.

3 participants