-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: sierra class hash benchmark (#601)
Also updates all benchmark results to use Apple M3 Max.
- Loading branch information
1 parent
56177d2
commit 548d2dd
Showing
7 changed files
with
60 additions
and
34 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,18 @@ | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
use starknet_core::types::contract::SierraClass; | ||
|
||
pub fn criterion_benchmark(c: &mut Criterion) { | ||
let contract_artifact: SierraClass = serde_json::from_str(include_str!( | ||
"../test-data/contracts/cairo1/artifacts/erc20_sierra.txt" | ||
)) | ||
.unwrap(); | ||
|
||
c.bench_function("sierra_class_hash", |b| { | ||
b.iter(|| { | ||
black_box(&contract_artifact).class_hash().unwrap(); | ||
}); | ||
}); | ||
} | ||
|
||
criterion_group!(benches, criterion_benchmark); | ||
criterion_main!(benches); |
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