3 ms·
Nix generally performs pretty well... as long as you're using the "right" commands. For example `nix-env -i git` takes about 30 seconds on my laptop (it evaluat
by ianthehenry 5y ago
Nix generally performs pretty well... as long as you're using the "right" commands. For example `nix-env -i git` takes about 30 seconds on my laptop (it evaluates the entire package universe and does a bunch of sorting and string comparison), but `nix-env -iA nixpkgs.git` takes about 600ms (it... doesn't).
`nix search` is really fast, and gives much better results than Homebrew's search. It creates a local cache of Nix evaluation results and searches that, and you have to update the cache yourself, but that hasn't bothered me in practice.
There isn't really an equivalent of `brew info`, but this is close:
$ time brew info git
git: stable 2.32.0 (bottled), HEAD
... lots of other stuff omitted...
0.98s user 1.28s system 61% cpu 3.678 total
$ time NIX_PAGER= nix-env -qaA nixpkgs.git --description
git-2.31.1 Distributed version control system
0.13s user 0.02s system 95% cpu 0.165 total
You can have a much faster package manager, if you're willing to put up with the ergonomics. i.e. Nix currently lacks an equivalent to `brew upgrade`, which is kind of bad. It has something that sounds like an upgrade (`nix-env --upgrade`), it doesn't actually do what you expect. And it takes several minutes to run, depending on how many packages you have installed.
Another performance datapoint:
$ time brew update
...infinite output omitted...
82.11s user 99.19s system 95% cpu 3:10.58 total
$ time nix-channel --update
unpacking channels...
created 1 symlinks in user environment
4.13s user 11.29s system 97% cpu 15.812 total
I haven't updated Homebrew in a while, which might explain part of the slowness there. But as the original post points out, Nix updates take the same amount of time regardless of how long it's been since you last updated.
- res0nat0r 5y agoI don't know if the reason brew is so slow anymore is because they changed the default 'brew search' command to query github for a bunch of matching regex open issues and return those results or what. I don't want it looking for packages upstream, just search locally. If I want the latest list of packages not cached on my system, I'll just run 'brew update'. And if 'brew update' is so slow now just due to the size of the .git repo growing so large over time.