-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d97b7f0
commit e8ad538
Showing
10 changed files
with
86 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#![no_main] | ||
sp1_zkvm::entrypoint!(main); | ||
|
||
#[sp1_derive::cycle_tracker] | ||
pub fn expensive_function(x: usize) -> usize { | ||
let mut y = 1; | ||
for _ in 0..100 { | ||
y *= x; | ||
y %= 7919; | ||
} | ||
y | ||
} | ||
|
||
pub fn main() { | ||
let mut nums = vec![1, 1]; | ||
|
||
// Setup a large vector with Fibonacci-esque numbers. | ||
println!("cycle-tracker-report-start: setup"); | ||
for _ in 0..100 { | ||
let mut c = nums[nums.len() - 1] + nums[nums.len() - 2]; | ||
c %= 7919; | ||
nums.push(c); | ||
} | ||
println!("cycle-tracker-report-end: setup"); | ||
} |
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
use sp1_helper::build_program; | ||
use sp1_helper::{build_program_with_args, BuildArgs}; | ||
|
||
fn main() { | ||
build_program("../program") | ||
build_program_with_args( | ||
"../program", | ||
BuildArgs { | ||
binary: "report".to_string(), | ||
..Default::default() | ||
}, | ||
); | ||
|
||
build_program_with_args( | ||
"../program", | ||
BuildArgs { | ||
binary: "normal".to_string(), | ||
..Default::default() | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters