-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fe501b
commit 20a4938
Showing
10 changed files
with
1,142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Notes for solving 2018 | ||
## Day 01: Chronal Calibration | ||
|
||
Again, first day is nothing to write home about: just iterate and sum, nothing too complicated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use advent_rs::year_2018::day_01; | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
|
||
fn year_2018_day_01(c: &mut Criterion) { | ||
let input = include_str!("../inputs/year_2018/day_01_input"); | ||
assert_eq!(day_01::day_01_v1(input), 484); | ||
assert_eq!(day_01::day_01_v2(input), 367); | ||
|
||
let mut g2018_day_01 = c.benchmark_group("year_2018::day_01"); | ||
g2018_day_01.bench_function("year_2018::day_01_v1", |b| { | ||
b.iter(|| day_01::day_01_v1(black_box(input))) | ||
}); | ||
g2018_day_01.bench_function("year_2018::day_01_v2", |b| { | ||
b.iter(|| day_01::day_01_v2(black_box(input))) | ||
}); | ||
g2018_day_01.finish(); | ||
} | ||
|
||
criterion_group!(benches, year_2018_day_01); | ||
criterion_main!(benches); |
Oops, something went wrong.