mirror of
https://github.com/logos-storage/zk-benchmarks.git
synced 2026-01-05 07:13:08 +00:00
criterion benchmarking removed, benchmarking using std::time
This commit is contained in:
parent
9fa3fe54f6
commit
ffb423610a
4
hash/risc0/bench/.gitignore
vendored
4
hash/risc0/bench/.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
.DS_Store
|
||||
Cargo.lock
|
||||
methods/guest/Cargo.lock
|
||||
target/
|
||||
5
hash/risc0/bench/.vscode/settings.json
vendored
5
hash/risc0/bench/.vscode/settings.json
vendored
@ -1,5 +0,0 @@
|
||||
{
|
||||
"rust-analyzer.linkedProjects": [
|
||||
"./methods/guest/Cargo.toml"
|
||||
]
|
||||
}
|
||||
2029
hash/risc0/bench/Cargo.lock
generated
Normal file
2029
hash/risc0/bench/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,12 +7,7 @@ edition = "2021"
|
||||
methods = { path = "../methods" }
|
||||
risc0-zkvm = { version = "0.19.0" }
|
||||
serde = "1.0"
|
||||
rand = "0.8.5"
|
||||
clap = {version = "4.4.8", features = [ "derive" ]}
|
||||
rand = "0.8.3"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = {version ="0.5.1", default-features = false}
|
||||
|
||||
[[bench]]
|
||||
name = "bench_main"
|
||||
harness = false
|
||||
criterion = "0.5.1"
|
||||
|
||||
@ -1,44 +0,0 @@
|
||||
use criterion::Criterion;
|
||||
// use clap::Parser;
|
||||
// use std::env;
|
||||
mod benchmarks;
|
||||
|
||||
fn main() {
|
||||
let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args();
|
||||
match std::env::args().skip(1).next() {
|
||||
Some(arg) => {
|
||||
match arg.as_str() {
|
||||
"1" => benchmarks::sha256_benchmarks::sha256_benchmarks_1kb(&mut criterion),
|
||||
"2" => benchmarks::sha256_benchmarks::sha256_benchmarks_2kb(&mut criterion),
|
||||
"10" => benchmarks::sha256_benchmarks::sha256_benchmarks_10kb(&mut criterion),
|
||||
_ => eprintln!("Invalid benchmark argument: {}", arg),
|
||||
}
|
||||
}
|
||||
None => {eprintln!("No benchmark")}
|
||||
}
|
||||
|
||||
criterion::Criterion::default().configure_from_args().final_summary();
|
||||
}
|
||||
|
||||
|
||||
// #[derive(Parser)]
|
||||
// #[command(author, version, about, long_about = None)]
|
||||
// struct Args {
|
||||
// #[clap(long, short)]
|
||||
// run_benchmark_function_one: bool,
|
||||
// #[clap(long, short)]
|
||||
// run_benchmark_function_two: bool,
|
||||
// }
|
||||
|
||||
// fn main(){
|
||||
// let args: Args = Args::parse();
|
||||
// let mut criterion: criterion::Criterion<_> = (Criterion::default().sample_size(10)).configure_from_args();
|
||||
|
||||
// if args.run_benchmark_function_one {
|
||||
// benchmarks::sha256_benchmarks::sha256_benchmarks1(&mut criterion);
|
||||
// }
|
||||
// if args.run_benchmark_function_two {
|
||||
// benchmarks::sha256_benchmarks22::sha256_benchmarks123(&mut criterion);
|
||||
// }
|
||||
// criterion::Criterion::default().configure_from_args().final_summary();
|
||||
// }
|
||||
@ -1 +0,0 @@
|
||||
pub mod sha256_benchmarks;
|
||||
@ -1,48 +0,0 @@
|
||||
use host::sha_bench;
|
||||
use criterion::Criterion;
|
||||
use rand::RngCore;
|
||||
|
||||
pub fn sha256_benchmarks_1kb(c: &mut Criterion) {
|
||||
c.bench_function(" sha256 on 1KB of random data:", |b| {
|
||||
//generating 1kb of random data in a vector of u8
|
||||
let mut data = [0u8; 64];
|
||||
rand::thread_rng().fill_bytes(&mut data);
|
||||
let input: Vec<u8> = data.to_vec();
|
||||
|
||||
// println!("{:?}", input);
|
||||
b.iter(|| {
|
||||
sha_bench(input.clone());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
pub fn sha256_benchmarks_2kb(c: &mut Criterion) {
|
||||
|
||||
c.bench_function(" sha256 on 2KB of random data:", |b| {
|
||||
//generating 2kb of random data in a vector of u8
|
||||
let mut data = [0u8; 128];
|
||||
rand::thread_rng().fill_bytes(&mut data);
|
||||
let input: Vec<u8> = data.to_vec();
|
||||
|
||||
// println!("{:?}", input);
|
||||
b.iter(|| {
|
||||
sha_bench(input.clone());
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
pub fn sha256_benchmarks_10kb(c: &mut Criterion) {
|
||||
|
||||
//generating 10kb of random data in a vector of u8
|
||||
let mut data = [0u8; 1280];
|
||||
rand::thread_rng().fill_bytes(&mut data);
|
||||
let input: Vec<u8> = data.to_vec();
|
||||
|
||||
c.bench_function(" sha256 on 10KB of random data:", |b| {
|
||||
|
||||
b.iter(|| {
|
||||
sha_bench(input.clone());
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
use methods::{
|
||||
METHOD_ELF, METHOD_ID
|
||||
};
|
||||
use risc0_zkvm::{default_prover, ExecutorEnv};
|
||||
use risc0_zkvm::{ sha};
|
||||
|
||||
pub fn sha_bench(input: Vec<u8>) {
|
||||
// Build an executor environment with the input.
|
||||
let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap();
|
||||
|
||||
// Obtain the default prover.
|
||||
let prover = default_prover();
|
||||
|
||||
// Produce a receipt by proving the specified ELF binary.
|
||||
let receipt = prover.prove_elf(env, METHOD_ELF).unwrap();
|
||||
|
||||
// For example:
|
||||
let _output: sha::Digest = receipt.journal.decode().unwrap();
|
||||
|
||||
// verify your receipt
|
||||
receipt.verify(METHOD_ID).unwrap();
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,47 @@
|
||||
use methods::{
|
||||
METHOD_ELF, METHOD_ID
|
||||
};
|
||||
use risc0_zkvm::{default_prover, ExecutorEnv};
|
||||
use risc0_zkvm::{ sha};
|
||||
// use rand::RngCore;
|
||||
use rand::Rng;
|
||||
use std::time::Instant;
|
||||
|
||||
fn generate_bytes(size: usize) -> Vec<u8> {
|
||||
let mut rng = rand::thread_rng();
|
||||
(0..size).map(|_| rng.gen()).collect()
|
||||
}
|
||||
|
||||
pub fn sha_bench(input: Vec<u8>) {
|
||||
|
||||
let start_time = Instant::now();
|
||||
|
||||
let env = ExecutorEnv::builder().write(&input).unwrap().build().unwrap();
|
||||
|
||||
// Obtain the default prover.
|
||||
let prover = default_prover();
|
||||
|
||||
// Produce a receipt by proving the specified ELF binary.
|
||||
let receipt = prover.prove_elf(env, METHOD_ELF).unwrap();
|
||||
|
||||
// TODO: Implement code for retrieving receipt journal here.
|
||||
|
||||
// For example:
|
||||
let _output: sha::Digest = receipt.journal.decode().unwrap();
|
||||
|
||||
// verify your receipt
|
||||
receipt.verify(METHOD_ID).unwrap();
|
||||
|
||||
let elapsed_time = start_time.elapsed();
|
||||
eprintln!("Total time: {:?}", elapsed_time);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
eprintln!("{:?}", &args[1]);
|
||||
// eprintln!("{:?}", &args[2]);
|
||||
let size_kb = args[1].parse::<usize>().unwrap();
|
||||
eprintln!("{:?}", size_kb);
|
||||
let input = generate_bytes(size_kb);
|
||||
sha_bench(input);
|
||||
}
|
||||
|
||||
442
hash/risc0/bench/methods/guest/Cargo.lock
generated
Normal file
442
hash/risc0/bench/methods/guest/Cargo.lock
generated
Normal file
@ -0,0 +1,442 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.75"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "blake2"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck"
|
||||
version = "1.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6"
|
||||
dependencies = [
|
||||
"bytemuck_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytemuck_derive"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "const-oid"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f"
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "downcast-rs"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
||||
|
||||
[[package]]
|
||||
name = "elf"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f6e7d85896690fe195447717af8eceae0593ac2196fd42fe88c184e904406ce"
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hex"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||
|
||||
[[package]]
|
||||
name = "method"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"risc0-zkvm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-derive"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
|
||||
[[package]]
|
||||
name = "risc0-binfmt"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73b008c7506a6acb15f14a87e7e57797fd901cdf2f4eb560a032df4e1fc12790"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"elf",
|
||||
"log",
|
||||
"risc0-zkp",
|
||||
"risc0-zkvm-platform",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-circuit-recursion"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "924bbd4f27070f04556e10565441fbf64e399763a3f244819f84dc645590bca1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytemuck",
|
||||
"log",
|
||||
"risc0-core",
|
||||
"risc0-zkp",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-circuit-rv32im"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ac44b6493d73638018d62eccec93f2797795d286c6201e2a79d842a16bbb43f"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
"risc0-core",
|
||||
"risc0-zkp",
|
||||
"risc0-zkvm-platform",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-core"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f8d9ff7ca4b8a9ecf63e4567dfc5ab73ea4c4c20618cdd36d5c0eb69be80cb2"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-zkp"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d1b8f047ec52f645e5e1c46f69303658f9cca96f0a2dcb78b4e7cadef5c2ac3d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"blake2",
|
||||
"bytemuck",
|
||||
"digest",
|
||||
"hex",
|
||||
"log",
|
||||
"paste",
|
||||
"rand_core",
|
||||
"risc0-core",
|
||||
"risc0-zkvm-platform",
|
||||
"serde",
|
||||
"sha2",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-zkvm"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4b51d8aa8a4b0a350cca2deb9ead841989ed601ca3091e33a8ee8e6f2453048"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytemuck",
|
||||
"cfg-if",
|
||||
"getrandom",
|
||||
"hex",
|
||||
"log",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"risc0-binfmt",
|
||||
"risc0-circuit-recursion",
|
||||
"risc0-circuit-rv32im",
|
||||
"risc0-core",
|
||||
"risc0-zkp",
|
||||
"risc0-zkvm-platform",
|
||||
"rrs-lib",
|
||||
"semver",
|
||||
"serde",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "risc0-zkvm-platform"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59e9d18c75958239e91213a181e836e28dfbede913e4de66fa36e2ad1d70fcdc"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"getrandom",
|
||||
"libm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rrs-lib"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001"
|
||||
dependencies = [
|
||||
"downcast-rs",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.192"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
dependencies = [
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.27"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.32"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
@ -8,3 +8,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
# If you want to try (experimental) std support, add `features = [ "std" ]` to risc0-zkvm
|
||||
risc0-zkvm = { version = "0.19.0", default-features = false, features = [ "std" ] }
|
||||
|
||||
# [lib]
|
||||
# name = "guest"
|
||||
# path = "src/mod.rs"
|
||||
@ -1,15 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if ZKBENCH_INPUT_SIZE_KB is set, otherwise set a default value
|
||||
ZKBENCH_INPUT_SIZE_KB=${ZKBENCH_INPUT_SIZE_KB:-"1"} # Default to 1 if not set
|
||||
# Set a default value if ZKBENCH_INPUT_SIZE_KB is not set
|
||||
: ${ZKBENCH_INPUT_SIZE_KB:=1024}
|
||||
|
||||
# Run benchmarks with the specified input size
|
||||
if [ "$ZKBENCH_INPUT_SIZE_KB" = "1" ]; then
|
||||
cargo bench --bench bench_main -- 1
|
||||
elif [ "$ZKBENCH_INPUT_SIZE_KB" = "2" ]; then
|
||||
cargo bench --bench bench_main -- 2
|
||||
elif [ "$ZKBENCH_INPUT_SIZE_KB" = "10" ]; then
|
||||
cargo bench --bench bench_main -- 10
|
||||
else
|
||||
echo "Invalid input size: $ZKBENCH_INPUT_SIZE_KB"
|
||||
fi
|
||||
# Run cargo run with the specified environment variable
|
||||
cargo run $ZKBENCH_INPUT_SIZE_KB
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user