Skip to content

Commit

Permalink
test(blockifier): use the jemalloc allocator for benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Feb 3, 2025
1 parent 962ea8c commit ee04cc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/blockifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ rstest.workspace = true
rstest_reuse.workspace = true
starknet_api = { path = "../starknet_api", features = ["testing"] }
test-case.workspace = true
tikv-jemallocator.workspace = true

[build-dependencies]
starknet_infra_utils.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions crates/blockifier/bench/blockifier_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ use blockifier::test_utils::transfers_generator::{
TransfersGeneratorConfig,
};
use criterion::{criterion_group, criterion_main, Criterion};
use starknet_infra_utils::set_global_allocator;

// TODO(Arni): Consider how to run this benchmark both with and without setting the allocator. Maybe
// hide this macro call under a feature, and run this benchmark regularly or with
// `cargo bench --bench blockifier_bench --feature=specified_allocator`
set_global_allocator!();

pub fn transfers_benchmark(c: &mut Criterion) {
let transfers_generator_config = TransfersGeneratorConfig {
Expand Down

0 comments on commit ee04cc7

Please sign in to comment.