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

NixOS evaluation speed regression #79943

Open
edolstra opened this issue Feb 12, 2020 · 10 comments
Open

NixOS evaluation speed regression #79943

edolstra opened this issue Feb 12, 2020 · 10 comments
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@edolstra
Copy link
Member

edolstra commented Feb 12, 2020

Describe the bug

NixOS evaluation has gotten ~2x slower since 18.09.

To Reproduce

$ command time nix-instantiate nixos/release-combined.nix -A nixos.tests.misc.x86_64-linux --dry-run

on my system (Ryzen 3700X) takes ~1.7s on 18.09, but ~3.2s on master. And for historical perspective, it takes 0.4s on 14.04.

Also, memory usage went from 113 MiB max resident in 14.04, to 395 MiB in 18.09, and 642 MiB on master. (This is with GC_INITIAL_HEAP_SIZE=1m.)

Edit: original numbers for master were inflated by the use of cleanSource, which adds about 2 seconds to evaluation time (3182fbd). But that didn't affect Hydra.

@edolstra edolstra added 0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 1.severity: blocker This is preventing another PR or issue from being completed 0.kind: regression Something that worked before working no longer labels Feb 12, 2020
@samueldr samueldr added this to the 20.03 milestone Feb 12, 2020
@edolstra
Copy link
Member Author

Maybe it's time to revisit NixOS/rfcs#22.

@grahamc
Copy link
Member

grahamc commented Feb 12, 2020

I'm hopeful that Flakes will make 22/(something like 22) an easy, obvious choice for growth for 20.09.

@edolstra
Copy link
Member Author

Flakes help with out-of-tree modules, but they're not necessary for modules that are in Nixpkgs but not in module-list.nix. Those can be imported using imports = [ (pkgs.path + "/nixos/modules/.../bla.nix") ].

@grahamc
Copy link
Member

grahamc commented Feb 12, 2020

Yeah, think we could create a way for people to contribute modules somewhere organized by the community and fetched via flakes -- instead of inclusion in to NixOS. One subtlety of my previous comment I want to point out is that I don't think we can make such changes for 20.03.

@edolstra edolstra removed the 1.severity: blocker This is preventing another PR or issue from being completed label Feb 12, 2020
@infinisil
Copy link
Member

Related is #57477

@infinisil infinisil added the 6.topic: module system About "NixOS" module system internals label Apr 2, 2020
@stale
Copy link

stale bot commented Sep 29, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 29, 2020
@veprbl veprbl removed this from the 20.03 milestone May 31, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 31, 2021
@roberth
Copy link
Member

roberth commented Sep 10, 2021

I've written down my thoughts in NixOS always imports all modules.

It's a low tech solution, which makes it viable. Also with flakes we'll need the same transformation to happen anyway.

@stale
Copy link

stale bot commented Apr 27, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 27, 2022
@infinisil
Copy link
Member

Still a problem

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 16, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 12, 2022
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/slow-nixos-rebuild/48059/7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

No branches or pull requests

7 participants