devshell/.nix/repo/benchmark.nix

19 lines
555 B
Nix
Raw 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 3 \
'nix-instantiate ${inputs.self}/benchmark/shared.nix' \
'nix-instantiate ${inputs.self}/benchmark/empty.nix'
echo "Now real benchmark:"
hyperfine -w 3 \
'nix-instantiate ${inputs.self}/benchmark/nixpkgs-shell.nix' \
'nix-instantiate ${inputs.self}/benchmark/devshell.nix'
'';
};
}