This makes computeFSClosure much faster in practice, because the graph is now traversed in an async BFS manner, while previously it serialised on each single path info query. For something like rm ~/.cache/nix/binary-cache-v7.sqlite && nix path-info --store https://cache.nixos.org --recursive /nix/store/7zz3zmv2a0ssmgqlfhy4rsb6ii6z475a-stdenv-linux.drv The difference is huge: (Before) Command being timed: "nix path-info --store https://cache.nixos.org --recursive /nix/store/7zz3zmv2a0ssmgqlfhy4rsb6ii6z475a-stdenv-linux.drv" User time (seconds): 0.07 System time (seconds): 0.06 Percent of CPU this job got: 1% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.88 (After) Command being timed: "build/src/nix/nix path-info --store https://cache.nixos.org --recursive /nix/store/7zz3zmv2a0ssmgqlfhy4rsb6ii6z475a-stdenv-linux.drv" User time (seconds): 0.07 System time (seconds): 0.04 Percent of CPU this job got: 22% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.49 Basically 20x speedup with just processing stuff in an async manner. Note that for now we have rather ad-hoc event loop just for computeClosure. This seems perfectly fine for now, but in the future we could extended it and possibly have a global even loop with multiple threads handling it. For now we have basic rate limiting <= 64 coroutines in flight which is smaller than CURLMOPT_MAX_CONCURRENT_STREAMS (100 by default). |
||
|---|---|---|
| .github | ||
| ci/gha | ||
| contrib | ||
| doc/manual | ||
| maintainers | ||
| misc | ||
| nix-meson-build-support | ||
| packaging | ||
| scripts | ||
| src | ||
| tests | ||
| .clang-format | ||
| .clang-tidy | ||
| .coderabbit.yaml | ||
| .dir-locals.el | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitignore | ||
| .shellcheckrc | ||
| .version | ||
| CITATION.cff | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| default.nix | ||
| docker.nix | ||
| flake.lock | ||
| flake.nix | ||
| HACKING.md | ||
| meson.build | ||
| meson.format | ||
| meson.options | ||
| README.md | ||
| shell.nix | ||
Nix
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Please refer to the Nix manual for more details.
Installation and first steps
Visit nix.dev for installation instructions and beginner tutorials.
Full reference documentation can be found in the Nix manual.
Building and developing
Follow instructions in the Nix reference manual to set up a development environment and build Nix from source.
Contributing
Check the contributing guide if you want to get involved with developing Nix.
Additional resources
Nix was created by Eelco Dolstra and developed as the subject of his PhD thesis The Purely Functional Software Deployment Model, published 2006. Today, a world-wide developer community contributes to Nix and the ecosystem that has grown around it.
- The Nix, Nixpkgs, NixOS Community on nixos.org
- Official documentation on nix.dev
- Nixpkgs is the largest, most up-to-date free software repository in the world
- NixOS is a Linux distribution that can be configured fully declaratively
- Discourse
- Matrix: #users:nixos.org for user support and #nix-dev:nixos.org for development
License
Nix is released under the LGPL v2.1.