aboutsummaryrefslogtreecommitdiff
path: root/zkvms
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2025-02-10 16:00:55 +0200
committerKamen Mladenov <kamen@syndamia.com>2025-02-10 16:00:55 +0200
commit6a310e1ae93acb0cf8943406322b6d01249a4ae4 (patch)
tree38ec2c6c74b926bbc45c87d288540b4236a4c226 /zkvms
parent85d00444e304974d386134ba1faffd554aac79ad (diff)
downloadzkVMs-benchmarks-6a310e1ae93acb0cf8943406322b6d01249a4ae4.tar
zkVMs-benchmarks-6a310e1ae93acb0cf8943406322b6d01249a4ae4.tar.gz
zkVMs-benchmarks-6a310e1ae93acb0cf8943406322b6d01249a4ae4.zip
fix(zkvms/risc0): Revert changes to benchmark only the relevant function calls
Diffstat (limited to 'zkvms')
-rw-r--r--zkvms/risc0/host/src/main.rs44
1 files changed, 20 insertions, 24 deletions
diff --git a/zkvms/risc0/host/src/main.rs b/zkvms/risc0/host/src/main.rs
index 6b255bd..c214c4e 100644
--- a/zkvms/risc0/host/src/main.rs
+++ b/zkvms/risc0/host/src/main.rs
@@ -35,42 +35,38 @@ fn main() {
let run_info = read_args();
match run_info.run_type {
- Execute => {
+ Execute => benchmarkable! {
+ // ExecutorEnv does not derive Clone
let env = build_env(&run_info.input);
let exec = default_executor();
- benchmarkable! {
- let output = default_executor()
- .execute(env, HELLO_GUEST_ELF)
- .unwrap()
- .receipt_claim
- .unwrap()
- .output
- .value()
- .unwrap();
- println!("{:#?}", output);
- }
+ let output = default_executor()
+ .execute(env, HELLO_GUEST_ELF)
+ .unwrap()
+ .receipt_claim
+ .unwrap()
+ .output
+ .value()
+ .unwrap();
+ println!("{:#?}", output);
},
- Prove => {
+ Prove => benchmarkable! {
+ // ExecutorEnv does not derive Clone
let env = build_env(&run_info.input);
-
- benchmarkable! {
- let receipt = prove(env);
- println!("Output from journal: {:?}", journal(receipt));
- }
+ let receipt = prove(env);
+ println!("Output from journal: {:?}", journal(receipt));
},
- Verify => {
+ Verify => benchmarkable!{
// https://github.com/risc0/risc0/blob/881e512732eca72849b2d0e263a1242aba3158af/risc0/build/src/lib.rs#L197-L199
let guest_id: Digest = Digest::from_hex(HELLO_GUEST_ID).unwrap();
+ // ExecutorEnv does not derive Clone
let env = build_env(&run_info.input);
let receipt = prove(env);
- benchmarkable! {
- receipt.verify(guest_id).unwrap();
- println!("Output from verify: {:?}", journal(receipt));
- }
+ let receipt = receipt.clone();
+ receipt.verify(guest_id.clone()).unwrap();
+ println!("Output from verify: {:?}", journal(receipt));
},
}
}
-