Are flakes notably slower than channels?

I have changed my NixOS’ configuration from channels to flake and I have the impression, that nixos-rebuild takes significantly more time, now. The delay might be in the range of two to six seconds or so.

Does anybody share my impression? If yes, what could be the reason?

Yes. In general, there is a perceived slowness when dealing with flakes.

Many users complain about it, some openly, some in private, and some just gave up, but so far it never got fixed.

5 Likes

Flakes will copy all your code to the nix store before evaluating. That doesn’t explain all of the slowness, but certainly some.

5 Likes

Nix also downloads the global registry every once in a while, which adds more overhead, and I’m pretty sure flake inputs are refreshed on cache ttl lapses. There’s a bunch of unnecesary data shoveling when you use flakes.

5 Likes

Thanks for your replies. I am still thinking, the discussed overhead does not justify the delay on todays hardware. Probably there is some potential for optimizations.

2 Likes

I agree that flakes seem much slower. Who asked for pure eval, copying to store and other stuff? Base Nix works fine already and provides enough reproducibility and pureness, and flakes push it into madness.

2 Likes