-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(starknet_gateway): create bench file for benchmark test
- Loading branch information
1 parent
2a1b6aa
commit d46eac5
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,37 @@ | ||
//! Benchmark module for the starknet gateway crate. It provides functionalities to benchmark | ||
//! the performance of the gateway service, including declare, deploy account and invoke | ||
//! transactions. | ||
//! | ||
//! There are four benchmark functions in this flow: `declare_benchmark`, | ||
//! `deploy_account_benchmark`, `invoke_benchmark` and `gateway_benchmark` which combines all of the | ||
//! types. Each of the functions measure the performance of the gateway handling randomly created | ||
//! txs of the respective type. | ||
//! | ||
//! Run the benchmarks using `cargo bench --bench gateway_bench`. | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
pub fn declare_benchmark(c: &mut Criterion) { | ||
c.bench_function("declares", |benchmark| benchmark.iter(|| {})); | ||
} | ||
|
||
pub fn deploy_account_benchmark(c: &mut Criterion) { | ||
c.bench_function("deploy_accounts", |benchmark| benchmark.iter(|| {})); | ||
} | ||
|
||
pub fn invoke_benchmark(c: &mut Criterion) { | ||
c.bench_function("invokes", |benchmark| benchmark.iter(|| {})); | ||
} | ||
|
||
pub fn gateway_benchmark(c: &mut Criterion) { | ||
c.bench_function("all_transaction_types", |benchmark| benchmark.iter(|| {})); | ||
} | ||
|
||
criterion_group!( | ||
benches, | ||
declare_benchmark, | ||
deploy_account_benchmark, | ||
invoke_benchmark, | ||
gateway_benchmark | ||
); | ||
criterion_main!(benches); |