lix/src/nix
jade 7575db522e Remove 100s of CPU time (10%) from build times (1465s -> 1302s)
I saw that boost/lexical_cast was costing about 100s in CPU time on our
compiles. We can fix this trivially by doing explicit template
instantiation in exactly one place and eliminating all other includes of
it, which is a code improvement anyway by hiding the boost.

Before:
```
lix/lix2 » ClangBuildAnalyzer --analyze buildtimeold.bin
Analyzing build trace from 'buildtimeold.bin'...
**** Time summary:
Compilation (551 times):
  Parsing (frontend):         1465.3 s
  Codegen & opts (backend):   1110.9 s

<snip>

**** Expensive headers:
178153 ms: ../src/libcmd/installable-value.hh (included 52 times, avg 3426 ms), included via:
  40x: command.hh
  5x: command-installable-value.hh
  3x: installable-flake.hh
  2x: <direct include>
  2x: installable-attr-path.hh

176217 ms: ../src/libutil/error.hh (included 246 times, avg 716 ms), included via:
  36x: command.hh installable-value.hh installables.hh derived-path.hh config.hh experimental-features.hh
  12x: globals.hh config.hh experimental-features.hh
  11x: file-system.hh file-descriptor.hh
  6x: serialise.hh strings.hh
  6x: <direct include>
  6x: archive.hh serialise.hh strings.hh
  ...

173243 ms: ../src/libstore/store-api.hh (included 152 times, avg 1139 ms), included via:
  55x: <direct include>
  39x: command.hh installable-value.hh installables.hh
  7x: libexpr.hh
  4x: local-store.hh
  4x: command-installable-value.hh installable-value.hh installables.hh
  3x: binary-cache-store.hh
  ...

170482 ms: ../src/libutil/serialise.hh (included 201 times, avg 848 ms), included via:
  37x: command.hh installable-value.hh installables.hh built-path.hh realisation.hh hash.hh
  14x: store-api.hh nar-info.hh hash.hh
  11x: <direct include>
  7x: primops.hh eval.hh attr-set.hh nixexpr.hh value.hh source-path.hh archive.hh
  7x: libexpr.hh value.hh source-path.hh archive.hh
  6x: fetchers.hh hash.hh
  ...

169397 ms: ../src/libcmd/installables.hh (included 53 times, avg 3196 ms), included via:
  40x: command.hh installable-value.hh
  5x: command-installable-value.hh installable-value.hh
  3x: installable-flake.hh installable-value.hh
  2x: <direct include>
  1x: installable-derived-path.hh
  1x: installable-value.hh
  ...

159740 ms: ../src/libutil/strings.hh (included 221 times, avg 722 ms), included via:
  37x: command.hh installable-value.hh installables.hh built-path.hh realisation.hh hash.hh serialise.hh
  19x: <direct include>
  14x: store-api.hh nar-info.hh hash.hh serialise.hh
  11x: serialise.hh
  7x: primops.hh eval.hh attr-set.hh nixexpr.hh value.hh source-path.hh archive.hh serialise.hh
  7x: libexpr.hh value.hh source-path.hh archive.hh serialise.hh
  ...

156796 ms: ../src/libcmd/command.hh (included 51 times, avg 3074 ms), included via:
  42x: <direct include>
  7x: command-installable-value.hh
  2x: installable-attr-path.hh

150392 ms: ../src/libutil/types.hh (included 251 times, avg 599 ms), included via:
  36x: command.hh installable-value.hh installables.hh path.hh
  11x: file-system.hh
  10x: globals.hh
  6x: fetchers.hh
  6x: serialise.hh strings.hh error.hh
  5x: archive.hh
  ...

133101 ms: /nix/store/644b90j1vms44nr18yw3520pzkrg4dd1-boost-1.81.0-dev/include/boost/lexical_cast.hpp (included 226 times, avg 588 ms), included via
:
  37x: command.hh installable-value.hh installables.hh built-path.hh realisation.hh hash.hh serialise.hh strings.hh
  19x: file-system.hh
  11x: store-api.hh nar-info.hh hash.hh serialise.hh strings.hh
  7x: primops.hh eval.hh attr-set.hh nixexpr.hh value.hh source-path.hh archive.hh serialise.hh strings.hh
  7x: libexpr.hh value.hh source-path.hh archive.hh serialise.hh strings.hh
  6x: eval.hh attr-set.hh nixexpr.hh value.hh source-path.hh archive.hh serialise.hh strings.hh
  ...

132887 ms: /nix/store/h2abv2l8irqj942i5rq9wbrj42kbsh5y-gcc-12.3.0/include/c++/12.3.0/memory (included 262 times, avg 507 ms), included via:
  36x: command.hh installable-value.hh installables.hh path.hh types.hh ref.hh
  16x: gtest.h
  11x: file-system.hh types.hh ref.hh
  10x: globals.hh types.hh ref.hh
  10x: json.hpp
  6x: serialise.hh
  ...

  done in 0.6s.
```

After:
```
lix/lix2 » maintainers/buildtime_report.sh build
Processing all files and saving to '/home/jade/lix/lix2/maintainers/../buildtime.bin'...
  done in 0.6s. Run 'ClangBuildAnalyzer --analyze /home/jade/lix/lix2/maintainers/../buildtime.bin' to analyze it.
Analyzing build trace from '/home/jade/lix/lix2/maintainers/../buildtime.bin'...
**** Time summary:
Compilation (551 times):
  Parsing (frontend):         1302.1 s
  Codegen & opts (backend):    956.3 s

<snip>

**** Expensive headers:
178145 ms: ../src/libutil/error.hh (included 246 times, avg 724 ms), included via:
  36x: command.hh installable-value.hh installables.hh derived-path.hh config.hh experimental-features.hh
  12x: globals.hh config.hh experimental-features.hh
  11x: file-system.hh file-descriptor.hh
  6x: <direct include>
  6x: serialise.hh strings.hh
  6x: fetchers.hh hash.hh serialise.hh strings.hh
  ...

154043 ms: ../src/libcmd/installable-value.hh (included 52 times, avg 2962 ms), included via:
  40x: command.hh
  5x: command-installable-value.hh
  3x: installable-flake.hh
  2x: <direct include>
  2x: installable-attr-path.hh

153593 ms: ../src/libstore/store-api.hh (included 152 times, avg 1010 ms), included via:
  55x: <direct include>
  39x: command.hh installable-value.hh installables.hh
  7x: libexpr.hh
  4x: local-store.hh
  4x: command-installable-value.hh installable-value.hh installables.hh
  3x: binary-cache-store.hh
  ...

149948 ms: ../src/libutil/types.hh (included 251 times, avg 597 ms), included via:
  36x: command.hh installable-value.hh installables.hh path.hh
  11x: file-system.hh
  10x: globals.hh
  6x: fetchers.hh
  6x: serialise.hh strings.hh error.hh
  5x: archive.hh
  ...

144560 ms: ../src/libcmd/installables.hh (included 53 times, avg 2727 ms), included via:
  40x: command.hh installable-value.hh
  5x: command-installable-value.hh installable-value.hh
  3x: installable-flake.hh installable-value.hh
  2x: <direct include>
  1x: installable-value.hh
  1x: installable-derived-path.hh
  ...

136585 ms: ../src/libcmd/command.hh (included 51 times, avg 2678 ms), included via:
  42x: <direct include>
  7x: command-installable-value.hh
  2x: installable-attr-path.hh

133394 ms: /nix/store/h2abv2l8irqj942i5rq9wbrj42kbsh5y-gcc-12.3.0/include/c++/12.3.0/memory (included 262 times, avg 509 ms), included via:
  36x: command.hh installable-value.hh installables.hh path.hh types.hh ref.hh
  16x: gtest.h
  11x: file-system.hh types.hh ref.hh
  10x: globals.hh types.hh ref.hh
  10x: json.hpp
  6x: serialise.hh
  ...

89315 ms: ../src/libstore/derived-path.hh (included 178 times, avg 501 ms), included via:
  37x: command.hh installable-value.hh installables.hh
  25x: store-api.hh realisation.hh
  7x: primops.hh eval.hh attr-set.hh nixexpr.hh value.hh context.hh
  6x: eval.hh attr-set.hh nixexpr.hh value.hh context.hh
  6x: libexpr.hh value.hh context.hh
  6x: shared.hh
  ...

87347 ms: /nix/store/h2abv2l8irqj942i5rq9wbrj42kbsh5y-gcc-12.3.0/include/c++/12.3.0/ostream (included 273 times, avg 319 ms), included via:
  35x: command.hh installable-value.hh installables.hh path.hh types.hh ref.hh memory unique_ptr.h
  12x: regex sstream istream
  10x: file-system.hh types.hh ref.hh memory unique_ptr.h
  10x: gtest.h memory unique_ptr.h
  10x: globals.hh types.hh ref.hh memory unique_ptr.h
  6x: fetchers.hh types.hh ref.hh memory unique_ptr.h
  ...

85249 ms: ../src/libutil/config.hh (included 213 times, avg 400 ms), included via:
  37x: command.hh installable-value.hh installables.hh derived-path.hh
  20x: globals.hh
  20x: logging.hh
  16x: store-api.hh logging.hh
  6x: <direct include>
  6x: eval.hh attr-set.hh nixexpr.hh value.hh context.hh derived-path.hh
  ...

  done in 0.5s.
```

Change-Id: I27f0a2d566db17832cd9be935f12efe7f95b92d0
2024-05-29 22:16:15 -07:00
..
realisation fix spelling mistakes reported by Debian's lintian tool 2022-01-30 10:51:39 +02: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 Simplify ContentAddress 2023-07-07 07:30:01 -04:00
app.cc Allow dynamic derivation deps in inputDrvs 2023-09-07 10:39:37 -04:00
build.cc Make the Derived Path family of types inductive for dynamic derivations 2023-08-10 00:08:32 -04:00
build.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
bundle.cc Overhaul completions, redo #6693 (#8131) 2024-03-25 15:30:36 +00:00
bundle.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
cat.cc nix cat/dump-path/key: stop progress bar before writeFull 2024-05-18 17:51:16 +00:00
config.cc Rename nix show-config to nix config show 2024-05-03 16:26:16 +02:00
copy.cc Make command infra less stateful and more regular 2023-03-15 16:29:07 -04:00
copy.md Also use long options in src/nix/*.md 2023-05-17 08:10:30 +01:00
daemon.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
daemon.md Port the flags of nix-daemon to nix daemon (#8788) 2023-08-28 13:43:34 +00:00
derivation-add.cc Create nix derivation add command 2023-04-07 08:34:58 -04:00
derivation-add.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
derivation-show.cc Rename files to reflect new nix derivation show name 2023-04-07 08:34:58 -04:00
derivation-show.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
derivation.cc nix show-derivation -> nix derivation show 2023-04-07 08:34:58 -04:00
develop.cc Remove 100s of CPU time (10%) from build times (1465s -> 1302s) 2024-05-29 22:16:15 -07:00
develop.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
diff-closures.cc refactor some nix-env and profile code to libcmd 2024-04-29 01:19:21 +00:00
diff-closures.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
doctor.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
dump-path.cc nix cat/dump-path/key: stop progress bar before writeFull 2024-05-18 17:51:16 +00:00
edit.cc util.{hh,cc}: Split out current-process.{hh,cc} 2024-05-29 11:01:34 +02:00
edit.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
eval.cc nix3-eval: don't elide top-level errors 2024-05-08 13:37:20 -06:00
eval.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
flake-archive.md Add 'nix flake' manpages 2020-12-23 18:26:40 +01:00
flake-check.md Also use long options in src/nix/*.md 2023-05-17 08:10:30 +01:00
flake-clone.md Add 'nix flake' manpages 2020-12-23 18:26:40 +01:00
flake-init.md Update docs 2022-02-22 14:32:56 +01:00
flake-lock.md Merge pull request #8817 from iFreilicht/flake-update-lock-overhaul 2024-03-25 17:36:24 -06: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 Update docs 2022-02-22 14:32:56 +01:00
flake-update.md Merge pull request #8817 from iFreilicht/flake-update-lock-overhaul 2024-03-25 17:36:24 -06:00
flake.cc Merge pull request #8817 from iFreilicht/flake-update-lock-overhaul 2024-03-25 17:36:24 -06:00
flake.md Document the path flakeref format (#8640) 2023-07-04 08:39:08 +00:00
fmt.cc Merge pull request #9494 from sellout/nix-run-execv 2024-03-04 07:11:25 +01:00
fmt.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
get-env.sh Merge pull request #9032 from Ma27/structured-attrs-env-vars 2024-03-07 10:46:47 +01:00
hash.cc Merge pull request #7750 from obsidiansystems/no-args-prepare 2023-03-15 17:23:40 -04:00
help-stores.md Tweaks 2023-03-23 15:32:59 +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 Fix missing ` in key manual 2022-06-08 11:46:50 +02:00
log.cc Make the Derived Path family of types inductive for dynamic derivations 2023-08-10 00:08:32 -04:00
log.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
ls.cc Get rid of some unchecked calls to std::cout 2023-03-02 15:02:24 +01:00
main.cc util.{hh,cc}: Split out namespaces.{hh,cc} 2024-05-29 11:41:16 +02:00
make-content-addressed.cc Make command infra less stateful and more regular 2023-03-15 16:29:07 -04:00
make-content-addressed.md clarify definition of "installable" 2023-03-05 01:46:17 +01:00
meson.build Rename nix show-config to nix config show 2024-05-03 16:26:16 +02: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 Also use long options in src/nix/*.md 2023-05-17 08:10:30 +01:00
nar.cc Make command infra less stateful and more regular 2023-03-15 16:29:07 -04:00
nar.md Add 'nix nar' manpages 2020-12-21 13:32:28 +01:00
nix.md docs: clarify how ^ works for -E/-f installables 2024-04-29 08:53:43 -06:00
optimise-store.cc util.hh: split out signals stuff 2024-03-11 00:52:09 -07:00
optimise-store.md Add 'nix store optimise' manpage 2020-12-21 13:32:28 +01:00
path-from-hash-part.cc Add command 'nix store path-from-hash-part' 2022-10-18 16:51:12 +02:00
path-from-hash-part.md Add command 'nix store path-from-hash-part' 2022-10-18 16:51:12 +02:00
path-info.cc Replace src/libutil/json.cc with nlohmann json generation 2022-11-16 16:50:50 +01:00
path-info.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
ping-store.cc Add Store::isTrustedClient() 2023-04-06 19:59:57 -04:00
ping-store.md Tweak 2021-01-17 19:49:28 +01:00
prefetch.cc filetransfer: remove decompress request parameter 2024-04-25 01:33:08 +02:00
print-dev-env.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06: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 docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
profile-list.md nix3-profile: remove indices 2024-05-02 12:02:28 -06:00
profile-remove.md Merge changes Id1a67156,I03f4c7c1,I146736bb,I3b1453cb into main 2024-05-03 13:39:49 +00:00
profile-rollback.md Generations -> profile versions 2021-09-14 19:57:45 +02:00
profile-upgrade.md Merge changes Id1a67156,I03f4c7c1,I146736bb,I3b1453cb into main 2024-05-03 13:39:49 +00:00
profile-wipe-history.md Add 'nix profile wipe-history' command 2021-09-14 20:35:41 +02:00
profile.cc nix3-profile: make element names stable 2024-05-02 12:59:15 -06:00
profile.md Dedup some markdown -> C++ big literal stuff in build system 2023-05-15 10:38:11 -04:00
realisation.cc Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04: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 Overhaul completions, redo #6693 (#8131) 2024-03-25 15:30:36 +00:00
registry.md doc: Fix typo 2022-06-28 22:43:37 -04:00
repl.cc Move evaluator settings (type and global) to separate file/header 2023-07-31 10:14:15 -04:00
repl.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
run.cc util.{hh,cc}: Split out current-process.{hh,cc} 2024-05-29 11:01:34 +02:00
run.hh Merge pull request #9494 from sellout/nix-run-execv 2024-03-04 07:11:25 +01:00
run.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
search.cc Merge pull request #9481 from iFreilicht/disallow-nix-search-without-search-terms 2024-03-04 08:40:12 +01:00
search.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
shell.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00
sigs.cc nix cat/dump-path/key: stop progress bar before writeFull 2024-05-18 17:51:16 +00:00
store-cat.md Add 'nix store' NAR-related manpages 2020-12-21 13:32:28 +01:00
store-copy-log.cc Fix misrendering of 'nix store --help' 2023-03-21 12:02:19 +01:00
store-copy-log.md link "store derivation" to glossary definition 2022-12-21 11:42:50 +01:00
store-delete.cc Make command infra less stateful and more regular 2023-03-15 16:29:07 -04:00
store-delete.md clarify definition of "installable" 2023-03-05 01:46:17 +01:00
store-dump-path.md clarify definition of "installable" 2023-03-05 01:46:17 +01:00
store-gc.cc Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
store-gc.md Add 'nix store gc' command 2021-01-10 23:29:14 +01:00
store-ls.md Also use long options in src/nix/*.md 2023-05-17 08:10:30 +01:00
store-prefetch-file.md Fix some typos 2021-03-26 16:14:38 +01:00
store-repair.cc Make command infra less stateful and more regular 2023-03-15 16:29:07 -04:00
store-repair.md clarify definition of "installable" 2023-03-05 01:46:17 +01:00
store.cc Move store docs to 'nix help-stores' 2023-03-21 14:37:09 +01:00
upgrade-nix.cc util.{hh,cc}: Split out processes.{hh,cc} 2024-05-29 11:01:34 +02:00
upgrade-nix.md Fix the pages in the manual for Lix 2024-05-05 16:11:01 -07:00
verify.cc util.hh: split out signals stuff 2024-03-11 00:52:09 -07:00
verify.md Also use long options in src/nix/*.md 2023-05-17 08:10:30 +01:00
why-depends.cc Overhaul completions, redo #6693 (#8131) 2024-03-25 15:30:36 +00:00
why-depends.md docs: guide to installables docs in installable commands' docs 2024-04-29 08:06:05 -06:00