Remove unnecessary allocations

This commit is contained in:
Anders Olsson
2023-10-24 16:10:40 +02:00
parent 59c256edad
commit d152e356f1
4 changed files with 108 additions and 83 deletions

View File

@@ -51,7 +51,8 @@ fn criterion_benchmark(criterion: &mut Criterion) {
weights.push(vec![vec![1.0], vec![1.0]]);
}
let mut batch = Batch::new(composition, results, weights, 1, P_DRAW, &agents);
let mut batch = Batch::new(1, P_DRAW);
batch.add_events(composition, results, weights, &agents);
criterion.bench_function("Batch::iteration", |b| {
b.iter(|| batch.iteration(0, &agents))