Added benchmarks
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#![feature(test)]
|
||||
use anyhow::Result;
|
||||
use aoc::Solver;
|
||||
|
||||
@@ -26,6 +27,19 @@ mod tests {
|
||||
fn part2_solution() -> Result<()> {
|
||||
Day::test(aoc::Part::TWO, "input", 206582)
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::ONE, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::TWO, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Solution --
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![feature(test)]
|
||||
use anyhow::Result;
|
||||
use aoc::Solver;
|
||||
|
||||
@@ -26,6 +27,19 @@ mod tests {
|
||||
fn part2_solution() -> Result<()> {
|
||||
Day::test(aoc::Part::TWO, "input", 12382)
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::ONE, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::TWO, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Implementation for hand --
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![feature(test)]
|
||||
use anyhow::Result;
|
||||
use aoc::Solver;
|
||||
|
||||
@@ -26,6 +27,19 @@ mod tests {
|
||||
fn part2_solution() -> Result<()> {
|
||||
Day::test(aoc::Part::TWO, "input", 2708)
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::ONE, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::TWO, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Helpers --
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![feature(test)]
|
||||
use std::cmp;
|
||||
use anyhow::Result;
|
||||
use aoc::Solver;
|
||||
@@ -27,6 +28,19 @@ mod tests {
|
||||
fn part2_solution() -> Result<()> {
|
||||
Day::test(aoc::Part::TWO, "input", 907)
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::ONE, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::TWO, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Implementation --
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![feature(test)]
|
||||
use core::fmt;
|
||||
use std::collections::HashMap;
|
||||
use lazy_static::lazy_static;
|
||||
@@ -31,6 +32,19 @@ mod tests {
|
||||
fn part2_solution() -> Result<()> {
|
||||
Day::test(aoc::Part::TWO, "input", "CNSFCGJSM".to_string())
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
extern crate test;
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part1_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::ONE, b)
|
||||
}
|
||||
#[bench]
|
||||
#[ignore]
|
||||
fn part2_bench(b: &mut test::Bencher) {
|
||||
Day::benchmark(aoc::Part::TWO, b)
|
||||
}
|
||||
}
|
||||
|
||||
// -- Implementation --
|
||||
|
||||
Reference in New Issue
Block a user