Created
February 24, 2022 11:27
-
-
Save thufschmitt/e2f664af98124cf67e6c7acae1c38e0c to your computer and use it in GitHub Desktop.
Nix eval cache benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nodes": { | |
"flake-utils": { | |
"locked": { | |
"lastModified": 1644229661, | |
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", | |
"owner": "numtide", | |
"repo": "flake-utils", | |
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", | |
"type": "github" | |
}, | |
"original": { | |
"owner": "numtide", | |
"repo": "flake-utils", | |
"type": "github" | |
} | |
}, | |
"nixpkgs": { | |
"locked": { | |
"lastModified": 1641528457, | |
"narHash": "sha256-FyU9E63n1W7Ql4pMnhW2/rO9OftWZ37pLppn/c1aisY=", | |
"path": "/nix/store/pwz0d92vl5hjrvhiri3qzazxjnf1r8wy-source", | |
"rev": "ff377a78794d412a35245e05428c8f95fef3951f", | |
"type": "path" | |
}, | |
"original": { | |
"id": "nixpkgs", | |
"type": "indirect" | |
} | |
}, | |
"root": { | |
"inputs": { | |
"flake-utils": "flake-utils", | |
"nixpkgs": "nixpkgs" | |
} | |
} | |
}, | |
"root": "root", | |
"version": 7 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "A basic flake with a shell"; | |
inputs.flake-utils.url = "github:numtide/flake-utils"; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: let | |
pkgs = nixpkgs.legacyPackages.${system}; | |
in { | |
devShell = pkgs.mkShell { | |
nativeBuildInputs = [ pkgs.bashInteractive pkgs.hyperfine ]; | |
buildInputs = [ ]; | |
}; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
rm -rf .direnv | |
mkdir -p .direnv | |
hyperfine --warmup 1 \ | |
"nix print-dev-env --option eval-cache false --profile .direnv/flake-profile-native" \ | |
"nix print-dev-env --profile .direnv/flake-profile-native" \ | |
"echo "" >> shell.nix && direnv export zsh" \ | |
"direnv export zsh" \ | |
"SHELL=true lorri shell" \ | |
"SHELL=true lorri shell --cached" \ | |
--export-markdown bench.md | |
git checkout flake.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(builtins.getFlake (builtins.toPath ./.)).outputs.devShell.${builtins.currentSystem} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment