Fix Day 21

This commit is contained in:
Christian
2023-12-28 13:47:30 +01:00
parent ebaba04774
commit af8413cba8
4 changed files with 214 additions and 113 deletions

View File

@@ -19,11 +19,18 @@
devShells = forAllSystems (pkgs: with pkgs; {
default = mkShell {
nativeBuildInputs = [ rustc cargo ];
buildInputs = [ hyperfine ];
nativeBuildInputs = [ rustc cargo clippy ];
buildInputs = [ hyperfine glow libiconv ];
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
shellHook = ''
bench() {
cargo build --release
DAY=$((($(date +%s)-$(date +%s --date "2023-11-30"))/(3600*24)))
hyperfine --parameter-list day $(seq --format "%02.f" 1 $DAY | paste -sd ',' -) "./target/release/day{day} ./data/{day}.in" --runs 20 --warmup 10 --shell=none --export-markdown ./target/bench-output.md 2> /dev/null
glow ./target/bench-output.md
}
'';
};
});
};
}