i have code like that needs to read from S3, like this:
fn bench_s3(c: &mut Criterion) {
let rt = tokio::runtime::Runtime::new().unwrap();
let mut get_group = c.benchmark_group("s3_get");
for (_, file) in files.iter().enumerate() {
get_group.bench_with_input(
BenchmarkId::new("single_file", file),
file,
|bencher, mybody| {
bencher
.to_async(&rt)
.iter(|| async { s3_get_single(file).await });
},
);
}
}
however, there needs to be a separate 'setup' part which actually PUTs those files to s3. and that portion will also be async. However, the bench_s3 method itself cannot be async. So where am I supposed to call the async setup method to setup my benchmarks?
i have code like that needs to read from S3, like this:
however, there needs to be a separate 'setup' part which actually PUTs those files to s3. and that portion will also be async. However, the
bench_s3
method itself cannot be async. So where am I supposed to call the async setup method to setup my benchmarks?