devshell/nix/repo/benchmark.nix

19 lines
651 B
Nix
Raw Permalink Normal View History

{inputs, ...}: let
inherit (inputs) pkgs;
in {
bench = pkgs.writeShellApplication {
2025-07-31 12:37:19 +02:00
name = "benchmark";
runtimeInputs = [pkgs.hyperfine];
2025-07-31 12:37:19 +02:00
text = ''
echo "Comparison cases first:"
hyperfine -w 5 \
'nix-instantiate ${inputs.self}/benchmark/shared.nix --quiet --quiet --quiet' \
'nix-instantiate ${inputs.self}/benchmark/empty.nix --quiet --quiet --quiet'
2025-07-31 12:37:19 +02:00
echo "Now real benchmark:"
hyperfine -w 5 \
'nix-instantiate ${inputs.self}/benchmark/nixpkgs-shell.nix --quiet --quiet --quiet' \
'nix-instantiate ${inputs.self}/benchmark/devshell.nix --quiet --quiet --quiet'
2025-07-31 12:37:19 +02:00
'';
};
}