mirror of
https://github.com/Smaug123/advent-of-code-2021
synced 2025-10-06 12:38:39 +00:00
Switch to cargo-criterion
This commit is contained in:
7
Cargo.lock
generated
7
Cargo.lock
generated
@@ -178,6 +178,13 @@ dependencies = [
|
||||
"criterion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "day_2"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.6.1"
|
||||
|
@@ -5,7 +5,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
||||
let input = input();
|
||||
c.bench_function("day 1 part 1", |b| {
|
||||
b.iter(|| {
|
||||
part_1(&input);
|
||||
part_1(&mut input.iter().copied());
|
||||
})
|
||||
});
|
||||
c.bench_function("day 1 part 2", |b| {
|
||||
|
Reference in New Issue
Block a user