Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix 2.23.3 run cache performance regression #1064

Closed
mjgallag opened this issue Jul 26, 2024 · 5 comments
Closed

nix 2.23.3 run cache performance regression #1064

mjgallag opened this issue Jul 26, 2024 · 5 comments

Comments

@mjgallag
Copy link
Contributor

Reruns are much slower in nix 2.23.3 then in nix 2.21.1 so you may want to reconsider it being your currently recommended version, see NixOS/nix#11193.

nix 2.21.1
nix run nixpkgs/2122a9b35b35719ad9a395fe783eabb092df01b1#cowsay hi  0.10s user 0.02s system 46% cpu 0.264 total
nix 2.23.3
nix run nixpkgs/2122a9b35b35719ad9a395fe783eabb092df01b1#cowsay hi  2.07s user 0.47s system 40% cpu 6.238 total
@cole-h
Copy link
Member

cole-h commented Jul 26, 2024

FWIW I was able to reproduce the performance regression in 2.21.1:

$ command time nix run github:nixos/nixpkgs/2122a9b35b35719ad9a395fe783eabb092df01b1#cowsay hi
 ____
< hi >
 ----
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
0.04user 0.00system 0:02.46elapsed 2%CPU (0avgtext+0avgdata 21248maxresident)k
1819inputs+0outputs (0major+3367minor)pagefaults 0swaps
$ nix --version
nix (Nix) 2.21.1

so I think it's mostly unrelated to 2.23.3.

@mjgallag
Copy link
Contributor Author

Interesting, I definitely see a stark difference, perhaps easier to detect on my ancient 8 year old mac ha ha. In any case it seems 2.23.4 may resolve it, see NixOS/nix#11193 (comment).

@cole-h
Copy link
Member

cole-h commented Jul 26, 2024

If you want to verify, the merge commit for the original PR that was backported is cached I believe, so nix shell github:nixos/nix/8ce4287409319e04f46ed1352deb956c30e35fc6 and then use that nix to nix run .... However, I was able to reproduce the slow performance issue at least once on that merge commit 🤷

@mjgallag
Copy link
Contributor Author

It appears 2.23.4 resolves the issue.

nix run github:nixos/nix/051f3773db212ad46f347ce586a241152a43180f -- --version
warning: unknown experimental feature 'repl-flake'
nix (Nix) 2.23.4
time nix run github:nixos/nix/051f3773db212ad46f347ce586a241152a43180f -- run nixpkgs/2122a9b35b35719ad9a395fe783eabb092df01b1#cowsay hi
warning: unknown experimental feature 'repl-flake'
 ____ 
< hi >
 ---- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
nix run github:nixos/nix/051f3773db212ad46f347ce586a241152a43180f -- run  hi  0.19s user 0.04s system 41% cpu 0.542 total

@sambacha
Copy link

This has been fixed in NixOS/nix#11086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants