mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-17 11:05:02 +01:00
benchmarks
This commit is contained in:
parent
5dff963dc2
commit
546149ae38
16 changed files with 517 additions and 188 deletions
|
|
@ -8,3 +8,8 @@ edition = "2021"
|
|||
[dependencies]
|
||||
nom.workspace = true
|
||||
helper.workspace = true
|
||||
divan.workspace = true
|
||||
|
||||
[[bench]]
|
||||
name = "benches"
|
||||
harness = false
|
||||
|
|
|
|||
3
2023/day3/benches/benches.rs
Normal file
3
2023/day3/benches/benches.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
day3::bench();
|
||||
}
|
||||
|
|
@ -1,20 +1,30 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use helper::{Day, Variants};
|
||||
use helper::Day;
|
||||
|
||||
fn main() {
|
||||
pub fn main() {
|
||||
helper::main::<Day3>(include_str!("../input.txt"));
|
||||
}
|
||||
|
||||
struct Day3;
|
||||
|
||||
helper::define_variants! {
|
||||
day => crate::Day3;
|
||||
part1 {
|
||||
basic => crate::part1;
|
||||
}
|
||||
part2 {
|
||||
basic => crate::part2;
|
||||
}
|
||||
}
|
||||
|
||||
impl Day for Day3 {
|
||||
fn part1() -> Variants {
|
||||
Variants::basic(part1)
|
||||
fn part1() -> helper::Variants {
|
||||
part1_variants!(construct_variants)
|
||||
}
|
||||
|
||||
fn part2() -> Variants {
|
||||
Variants::basic(part2)
|
||||
fn part2() -> helper::Variants {
|
||||
part2_variants!(construct_variants)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -128,3 +138,5 @@ helper::tests! {
|
|||
default => 81939900;
|
||||
}
|
||||
}
|
||||
|
||||
helper::benchmarks! {}
|
||||
3
2023/day3/src/mainrs
Normal file
3
2023/day3/src/mainrs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
day3::main();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue