Added benchmarks

This commit is contained in:
2022-12-06 02:17:08 +01:00
parent ee9dcc92c1
commit c75da6c077
7 changed files with 104 additions and 5 deletions

View File

@@ -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 --

View File

@@ -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 --

View File

@@ -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 --

View File

@@ -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 --

View File

@@ -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 --