devshell/.nix/repo/benchmark.nix

18 lines
555 B
Nix

{inputs, ...}: let
inherit (inputs) pkgs;
in {
bench = pkgs.writeShellApplication {
name = "benchmark";
runtimeInputs = [pkgs.hyperfine];
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'
'';
};
}