Fix Day 21
This commit is contained in:
13
flake.nix
13
flake.nix
@@ -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
|
||||
}
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user