Skip to content

Commit

Permalink
Add Nova Public Parameter benchmark for SDK
Browse files Browse the repository at this point in the history
Summary:

Test Plan:
  • Loading branch information
duc-nx committed Aug 13, 2024
1 parent 6c88c1c commit de9d945
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ jobs:
run: |
cargo bench --bench riscv_machine
bench-nova-public-params:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- uses: actions/checkout@v4
- name: Run benchmarks
run: |
cargo bench --bench nova_public_parameter_generation
12 changes: 11 additions & 1 deletion sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ categories = { workspace = true }
[dependencies]
serde.workspace = true

nexus-core = { path = "../core", features = ["prover_nova", "prover_jolt", "prover_hypernova"] }
nexus-core = { path = "../core", features = [
"prover_nova",
"prover_jolt",
"prover_hypernova",
] }
nexus-macro = { path = "../macro" }
postcard = { version = "1.0.8", features = ["alloc"] }
uuid = { version = "1.9.1", features = ["v4", "fast-rng"] }
thiserror = "1.0.61"

[dev-dependencies]
nexus-profiler = { path = "../macro/profiler" }
iai-callgrind = "0.12.2"

[lib]
doctest = false

[[bench]]
name = "nova_public_parameter_generation"
harness = false

19 changes: 19 additions & 0 deletions sdk/benches/nova_public_parameter_generation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use iai_callgrind::{library_benchmark, library_benchmark_group, main};
use nexus_sdk::nova;
use nexus_sdk::Parameters;

fn nova_public_parameter_generation() {
nova::seq::PP::generate_for_testing().expect("Failed to generate Nova public parameters");
}

#[library_benchmark]
fn bench_nova_public_parameter() -> () {
nova_public_parameter_generation()
}

library_benchmark_group!(
name = nova_public_parameter;
benchmarks = bench_nova_public_parameter
);

main!(library_benchmark_groups = nova_public_parameter);

0 comments on commit de9d945

Please sign in to comment.