Skip to content

Commit

Permalink
benchmarks: leverage zksync-home to get proper path
Browse files Browse the repository at this point in the history
  • Loading branch information
fkrause98 committed Aug 27, 2024
1 parent 67d2d32 commit 9f37923
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions core/tests/vm-benchmark/benches/criterion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ use criterion::{
use zksync_types::Transaction;
use zksync_vm_benchmark_harness::{
cut_to_allowed_bytecode_size, get_deploy_tx, get_heavy_load_test_tx, get_load_test_deploy_tx,
get_load_test_tx, get_realistic_load_test_tx, BenchmarkingVm, BenchmarkingVmFactory, Fast, Lambda,
Legacy, LoadTestParams,
get_load_test_tx, get_realistic_load_test_tx, BenchmarkingVm, BenchmarkingVmFactory, Fast,
Lambda, Legacy, LoadTestParams,
};

const SAMPLE_SIZE: usize = 20;

const ZKSYNC_HOME: &str = std::env::var("ZKSYNC_HOME");
const BENCH_PATH: &str = format!(
"{}/core/tests/vm-benchmark/deployment_bechmarks",
ZKSYNC_HOME
);
fn benches_in_folder<VM: BenchmarkingVmFactory, const FULL: bool>(c: &mut Criterion) {
let mut group = c.benchmark_group(VM::LABEL.as_str());
group
.sample_size(SAMPLE_SIZE)
.measurement_time(Duration::from_secs(10));

for path in std::fs::read_dir("deployment_benchmarks").unwrap() {
for path in std::fs::read_dir(BENCH_PATH).unwrap() {
let path = path.unwrap().path();

let test_contract = std::fs::read(&path).expect("failed to read file");
Expand Down

0 comments on commit 9f37923

Please sign in to comment.