lix/src/nix
pennae 7d4cc5515c defer formals duplicate check for incresed efficiency all round
if we defer the duplicate argument check for lambda formals we can use more
efficient data structures for the formals set, and we can get rid of the
duplication of formals names to boot. instead of a list of formals we've seen
and a set of names we'll keep a vector instead and run a sort+dupcheck step
before moving the parsed formals into a newly created lambda. this improves
performance on search and rebuild by ~1%, pure parsing gains more (about 4%).

this does reorder lambda arguments in the xml output, but the output is still
stable. this shouldn't be a problem since argument order is not semantically
important anyway.

 before

  nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      8.550 s ±  0.060 s    [User: 6.470 s, System: 1.664 s]
    Range (min … max):    8.435 s …  8.666 s    20 runs

  nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     346.7 ms ±   2.1 ms    [User: 312.4 ms, System: 34.2 ms]
    Range (min … max):   343.8 ms … 353.4 ms    20 runs

  nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.720 s ±  0.031 s    [User: 2.415 s, System: 0.231 s]
    Range (min … max):    2.662 s …  2.780 s    20 runs

 after

  nix search --no-eval-cache --offline ../nixpkgs hello
    Time (mean ± σ):      8.462 s ±  0.063 s    [User: 6.398 s, System: 1.661 s]
    Range (min … max):    8.339 s …  8.542 s    20 runs

  nix eval -f ../nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
    Time (mean ± σ):     329.1 ms ±   1.4 ms    [User: 296.8 ms, System: 32.3 ms]
    Range (min … max):   326.1 ms … 330.8 ms    20 runs

  nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
    Time (mean ± σ):      2.687 s ±  0.035 s    [User: 2.392 s, System: 0.228 s]
    Range (min … max):    2.626 s …  2.754 s    20 runs
2022-01-19 17:07:29 +01:00
..
realisation Add a nix realisation command for working on realisations 2021-03-09 10:16:44 +01:00
add-file.md Split 'nix store add-to-store' into 'add-path' and 'add-file' 2020-12-04 00:59:24 +01:00
add-path.md Split 'nix store add-to-store' into 'add-path' and 'add-file' 2020-12-04 00:59:24 +01:00
add-to-store.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
app.cc Add Installable::toDrvPaths() 2022-01-18 17:28:18 +01:00
build.cc std::visit by reference 2021-09-30 21:35:09 +00:00
build.md Fix some typos 2021-03-26 16:14:38 +01:00
bundle.cc Ensure that attrsets are sorted 2022-01-04 18:00:33 +01:00
bundle.md Add TODO 2020-12-23 18:26:40 +01:00
cat.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
copy.cc Add command 'nix store copy-log' 2022-01-18 14:08:49 +01:00
copy.md Add 'nix copy' manpage 2020-12-21 13:32:27 +01:00
daemon.cc Don't ignore SIGCHLD in createUnixDomainSocket() 2021-10-05 13:23:16 +02:00
daemon.md Add 'nix daemon' command 2021-01-14 00:05:04 +01:00
describe-stores.cc Remove static variable name clashes 2020-10-06 13:49:20 +02:00
develop.cc Remove CPU locking 2021-12-22 15:56:25 +01:00
develop.md nix develop: add --unpack 2021-10-09 01:19:50 +03:00
diff-closures.cc Use eval-store in more places 2021-07-22 09:59:51 +02:00
diff-closures.md Add 'nix store diff-closures' manpage 2020-12-21 13:32:29 +01:00
doctor.cc Split out local-fs-store.hh 2020-10-09 20:18:08 +00:00
dump-path.cc Add 'nix store' NAR-related manpages 2020-12-21 13:32:28 +01:00
edit.cc Rename findDerivationFilename -> findPackageFilename 2021-07-19 18:10:10 +02:00
edit.md Add 'nix edit' manpage 2020-12-21 13:32:28 +01:00
eval.cc toJSON: report error position for fancier output 2021-10-25 21:17:52 +00:00
eval.md Add 'nix eval' manpage 2020-12-21 13:32:28 +01:00
flake-archive.md Add 'nix flake' manpages 2020-12-23 18:26:40 +01:00
flake-check.md nix flake check: Fix markdown 2021-11-24 13:53:09 +01:00
flake-clone.md Add 'nix flake' manpages 2020-12-23 18:26:40 +01:00
flake-init.md Fix some typos 2021-03-26 16:14:38 +01:00
flake-lock.md nix flake update: Recreate the lock file 2021-02-26 14:55:54 +01:00
flake-metadata.md Merge 'nix flake {info,list-inputs}' into 'nix flake metadata' 2021-03-16 17:19:04 +01:00
flake-new.md Add 'nix flake' manpages 2020-12-23 18:26:40 +01:00
flake-prefetch.md nix store prefetch-tarball -> nix flake prefetch 2021-01-11 12:36:39 +01:00
flake-show.md Ensure nix flake show produces valid json 2021-09-08 19:38:22 -04:00
flake-update.md nix flake update: Recreate the lock file 2021-02-26 14:55:54 +01:00
flake.cc defer formals duplicate check for incresed efficiency all round 2022-01-19 17:07:29 +01:00
flake.md Document searching upwards and fix documentation for installables 2022-01-14 17:58:03 +03:00
get-env.sh Merge branch 'master' into structured-attrs-shell 2021-07-12 15:49:39 +02:00
hash.cc Remove mkFlag() 2021-01-27 12:06:03 +01:00
help.md Add 'nix help' manpage 2020-12-21 13:32:29 +01:00
key-convert-secret-to-public.md Add commands for generating secret/public keys 2021-01-06 17:49:31 +01:00
key-generate-secret.md Rename 'nix store sign-paths' to 'nix store sign' 2021-01-13 23:32:37 +01:00
local.mk nix --help: Display help using lowdown instead of man 2021-09-13 14:45:21 +02:00
log.cc std::visit by reference 2021-09-30 21:35:09 +00:00
log.md Tweak 2020-12-21 13:32:28 +01:00
ls.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
main.cc Show build and substitution information when not connected to a TTY 2022-01-17 19:57:29 +03:00
make-content-addressable.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
make-content-addressable.md Add 'nix store make-content-addressable' manpage 2020-12-21 13:32:29 +01:00
nar-cat.md Add 'nix nar' manpages 2020-12-21 13:32:28 +01:00
nar-dump-path.md Add 'nix nar' manpages 2020-12-21 13:32:28 +01:00
nar-ls.md Add 'nix nar' manpages 2020-12-21 13:32:28 +01:00
nar.cc Make '--help' do the same as 'help' (i.e. show a manpage) 2021-01-25 14:38:15 +01:00
nar.md Add 'nix nar' manpages 2020-12-21 13:32:28 +01:00
nix.md Fix the rendering of the example directory tree 2022-01-18 10:55:00 +01:00
optimise-store.cc Add 'nix store optimise' manpage 2020-12-21 13:32:28 +01:00
optimise-store.md Add 'nix store optimise' manpage 2020-12-21 13:32:28 +01:00
path-info.cc run(): Move 2021-09-27 11:12:06 +02:00
path-info.md Fix markdown error 2021-09-13 14:44:53 +02:00
ping-store.cc Add 'nix store ping' manpage 2020-12-21 13:32:28 +01:00
ping-store.md Tweak 2021-01-17 19:49:28 +01:00
prefetch.cc Use Bindings::{get,need} instead of find 2021-09-13 13:53:24 +02:00
print-dev-env.md nix print-dev-env: Add --json flag 2021-07-09 12:10:48 +02:00
profile-diff-closures.md Add 'nix profile' manpage 2020-12-21 13:32:29 +01:00
profile-history.md nix profile history: Show profile date 2021-09-14 20:47:33 +02:00
profile-install.md Add 'nix profile' manpage 2020-12-21 13:32:29 +01:00
profile-list.md nix profile info -> nix profile list 2021-01-12 19:57:05 +01:00
profile-remove.md man: fix formatting of nix3-profile-remove 2021-06-28 16:27:03 +02:00
profile-rollback.md Generations -> profile versions 2021-09-14 19:57:45 +02:00
profile-upgrade.md fix doc: nix profile info -> nix profile list 2021-05-24 12:36:08 +02:00
profile-wipe-history.md Add 'nix profile wipe-history' command 2021-09-14 20:35:41 +02:00
profile.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
profile.md Add 'nix profile' manpage 2020-12-21 13:32:29 +01:00
realisation.cc Make experimental-features a proper type 2021-10-26 07:02:31 +02:00
registry-add.md nix registry: add --registry flag 2021-06-30 22:13:32 +03:00
registry-list.md Add 'nix registry' manpages 2020-12-21 13:32:27 +01:00
registry-pin.md Style tweaks 2021-07-07 10:02:55 +02:00
registry-remove.md nix registry: add --registry flag 2021-06-30 22:13:32 +03:00
registry.cc nix registry: Mark experimental 2021-11-12 03:18:31 -05:00
registry.md Fix typo 2021-11-27 23:29:48 +03:00
repl.cc Merge pull request #5812 from pennae/small-perf-improvements 2022-01-17 19:49:52 +01:00
repl.md nix repl: add :log 2021-12-06 16:52:50 +03:00
run.cc Remove CPU locking 2021-12-22 15:56:25 +01:00
run.hh nix develop: Support chroot stores 2021-07-27 14:24:03 +02:00
run.md nix run: Tweak docs 2021-12-13 19:14:32 +01:00
search.cc Disable IFD selectively 2021-09-22 17:15:07 +02:00
search.md Add 'nix search' manpage 2020-12-21 13:32:27 +01:00
shell.md Fix typo in src/nix/shell.md 2021-12-15 23:40:37 -08:00
show-config.cc Forward the whole Nix config to the post-build-hook 2021-07-15 18:41:56 +02:00
show-derivation.cc std::visit by reference 2021-09-30 21:35:09 +00:00
show-derivation.md Add 'nix show-derivation' manpage 2020-12-21 13:32:29 +01:00
sigs.cc nix key: Fix error message and don't require flakes 2021-11-11 21:31:26 -05:00
store-cat.md Add 'nix store' NAR-related manpages 2020-12-21 13:32:28 +01:00
store-copy-log.cc Add Installable::toDrvPaths() 2022-01-18 17:28:18 +01:00
store-copy-log.md Add examples 2022-01-18 17:37:04 +01:00
store-delete.cc run(): Move 2021-09-27 11:12:06 +02:00
store-delete.md Add 'nix store delete' command 2021-01-11 19:46:59 +01:00
store-dump-path.md Add 'nix store' NAR-related manpages 2020-12-21 13:32:28 +01:00
store-gc.cc Convert option descriptions to Markdown 2021-01-13 14:18:04 +01:00
store-gc.md Add 'nix store gc' command 2021-01-10 23:29:14 +01:00
store-ls.md Add 'nix store' NAR-related manpages 2020-12-21 13:32:28 +01:00
store-prefetch-file.md Fix some typos 2021-03-26 16:14:38 +01:00
store-repair.cc run(): Move 2021-09-27 11:12:06 +02:00
store-repair.md Add 'nix store repair' command 2021-01-13 23:27:39 +01:00
store.cc Make '--help' do the same as 'help' (i.e. show a manpage) 2021-01-25 14:38:15 +01:00
upgrade-nix.cc Get rid of std::shared_ptr<std::string> and ref<std::string> 2022-01-18 11:12:30 +01:00
upgrade-nix.md Add 'nix upgrade-nix' manpage 2020-12-21 13:32:28 +01:00
verify.cc run(): Move 2021-09-27 11:12:06 +02:00
verify.md Add 'nix store verify' manpage 2020-12-21 13:32:28 +01:00
why-depends.cc Start the pager early-enough in nix why-depends 2022-01-14 13:41:45 +01:00
why-depends.md Add 'nix why-depends' manpage 2020-12-21 13:32:28 +01:00