Make the build faster >:3 #159

Open
opened 2024-03-19 04:58:33 +00:00 by jade · 1 comment
Owner

So, given that we have a meson build, I took the opportunity to dump -ftime-trace into the clang args, and then dumped the whole thing into ClangBuildAnalyzer.

Here is the report. I suspect we might be able to chop a lot of silliness off of it.

lix/lix » ClangBuildAnalyzer --analyze capture.bin                                                                                                                                                change-580
Analyzing build trace from 'capture.bin'...
**** Time summary:
Compilation (410 times):
  Parsing (frontend):         1382.5 s
  Codegen & opts (backend):    859.5 s

**** Files that took longest to parse (compiler frontend):
 10543 ms: build/src/nix/nix.p/flake.cc.o
 10189 ms: build/src/nix/nix.p/profile.cc.o
 10173 ms: build/src/libexpr/libnixexpr.so.p/eval.cc.o
  9934 ms: build/src/libexpr/libnixexpr.so.p/primops.cc.o
  9796 ms: build/src/libstore/libnixstore.so.p/derivations.cc.o
  9491 ms: build/src/libstore/libnixstore.so.p/build_local-derivation-goal.cc.o
  9485 ms: build/src/libstore/libnixstore.so.p/s3-binary-cache-store.cc.o
  9367 ms: build/src/nix/nix.p/search.cc.o
  9333 ms: build/src/libcmd/libnixcmd.so.p/installables.cc.o
  9167 ms: build/src/libstore/libnixstore.so.p/store-api.cc.o

**** Files that took longest to codegen (compiler backend):
 24663 ms: build/src/libexpr/libnixexpr.so.p/primops_fromTOML.cc.o
 22896 ms: build/src/libexpr/libnixexpr.so.p/primops.cc.o
 21343 ms: build/src/libstore/libnixstore.so.p/build_local-derivation-goal.cc.o
 16706 ms: build/src/libstore/libnixstore.so.p/store-api.cc.o
 15053 ms: build/src/libstore/libnixstore.so.p/binary-cache-store.cc.o
 13761 ms: build/src/libexpr/libnixexpr.so.p/eval.cc.o
 12275 ms: build/src/libstore/libnixstore.so.p/gc.cc.o
 12236 ms: build/src/nix/nix.p/develop.cc.o
 12059 ms: build/src/libfetchers/libnixfetchers.so.p/github.cc.o
 11278 ms: build/src/libstore/libnixstore.so.p/build_derivation-goal.cc.o

**** Templates that took longest to instantiate:
132524 ms: nlohmann::basic_json<>::parse<const char *> (199 times, avg 665 ms)
 90235 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 453 ms)
 78626 ms: nlohmann::basic_json<>::basic_json (807 times, avg 97 ms)
 71325 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 358 ms)
 51173 ms: nlohmann::basic_json<>::json_value::json_value (1019 times, avg 50 ms)
 29994 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 150 ms)
 22101 ms: nix::HintFmt::HintFmt<nix::Uncolored<std::basic_string<char>>> (398 times, avg 55 ms)
 16991 ms: boost::basic_format<char>::basic_format (398 times, avg 42 ms)
 14421 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 72 ms)
 13702 ms: boost::basic_format<char>::parse (199 times, avg 68 ms)
 10931 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_poi... (199 times, avg 54 ms)
 10881 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms)
 10840 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms)
 10796 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms)
 10759 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<nlohmann::d... (199 times, avg 54 ms)
 10730 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms)
 10699 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms)
 10671 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms)
 10629 ms: nlohmann::detail::conjunction<nlohmann::detail::is_detected_lazy<nlo... (199 times, avg 53 ms)
 10626 ms: nlohmann::detail::is_detected_lazy<nlohmann::detail::get_template_fu... (199 times, avg 53 ms)
 10259 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 51 ms)
 10031 ms: std::basic_regex<char>::_M_compile (22 times, avg 455 ms)
  9600 ms: std::__detail::_Compiler<std::regex_traits<char>>::_Compiler (22 times, avg 436 ms)
  9328 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 46 ms)
  9112 ms: nlohmann::basic_json<>::create<std::map<std::basic_string<char>, nlo... (199 times, avg 45 ms)
  8551 ms: nlohmann::detail::external_constructor<nlohmann::detail::value_t::st... (218 times, avg 39 ms)
  8362 ms: nlohmann::basic_json<>::basic_json<std::basic_string<char> &, std::b... (199 times, avg 42 ms)
  8320 ms: nlohmann::adl_serializer<std::basic_string<char>>::to_json<nlohmann:... (199 times, avg 41 ms)
  8293 ms: nlohmann::detail::to_json_fn::operator()<nlohmann::basic_json<>, std... (199 times, avg 41 ms)
  8153 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_disjunction (22 times, avg 370 ms)

**** Template sets that took longest to instantiate:
132975 ms: nlohmann::basic_json<$>::parse<$> (213 times, avg 624 ms)
 90453 ms: nlohmann::detail::parser<$>::parse (212 times, avg 426 ms)
 81726 ms: nlohmann::detail::parser<$>::sax_parse_internal<$> (425 times, avg 192 ms)
 53666 ms: nlohmann::basic_json<$>::basic_json (626 times, avg 85 ms)
 52698 ms: nlohmann::basic_json<$>::create<$> (1705 times, avg 30 ms)
 51173 ms: nlohmann::basic_json<$>::json_value::json_value (1019 times, avg 50 ms)
 49996 ms: std::__do_visit<$> (3180 times, avg 15 ms)
 42856 ms: std::__detail::__variant::__gen_vtable_impl<$>::__visit_invoke (9866 times, avg 4 ms)
 38600 ms: std::__detail::__variant::__raw_idx_visit<$> (2144 times, avg 18 ms)
 35701 ms: std::unique_ptr<$> (2601 times, avg 13 ms)
 30921 ms: std::__and_<$> (25572 times, avg 1 ms)
 29994 ms: nlohmann::detail::json_sax_dom_callback_parser<$>::end_object (199 times, avg 150 ms)
 29657 ms: std::__uniq_ptr_data<$> (2601 times, avg 11 ms)
 29298 ms: std::__uniq_ptr_impl<$> (2601 times, avg 11 ms)
 27386 ms: nlohmann::detail::conjunction<$> (1264 times, avg 21 ms)
 26090 ms: std::tuple<$> (5531 times, avg 4 ms)
 25850 ms: std::__tuple_compare<$>::__eq (2587 times, avg 9 ms)
 25730 ms: std::allocator_traits<$>::construct<$> (7634 times, avg 3 ms)
 25679 ms: nlohmann::detail::is_detected_lazy<$> (1028 times, avg 24 ms)
 24903 ms: std::variant<$> (1722 times, avg 14 ms)
 24022 ms: std::__invoke_result<$> (9380 times, avg 2 ms)
 22363 ms: std::optional<$> (2563 times, avg 8 ms)
 21805 ms: std::__result_of_impl<$> (7876 times, avg 2 ms)
 21588 ms: nix::HintFmt::HintFmt<$> (706 times, avg 30 ms)
 20988 ms: std::__or_<$> (24658 times, avg 0 ms)
 19773 ms: std::pair<$> (4601 times, avg 4 ms)
 19668 ms: std::_Rb_tree<$>::~_Rb_tree (2156 times, avg 9 ms)
 19242 ms: std::_Rb_tree<$>::_M_erase (2180 times, avg 8 ms)
 18637 ms: std::tie<$> (2549 times, avg 7 ms)
 18402 ms: nlohmann::detail::json_sax_dom_callback_parser<$>::handle_value<$> (1393 times, avg 13 ms)

**** Functions that took longest to compile:
  1780 ms: nix::fetchers::GitInputScheme::fetch(nix::ref<nix::Store>, nix::fetc... (../src/libfetchers/git.cc)
  1599 ms: _GLOBAL__sub_I_primops.cc (../src/libexpr/primops.cc)
  1248 ms: nix::Settings::Settings() (../src/libstore/globals.cc)
   967 ms: nix::LocalDerivationGoal::startBuilder() (../src/libstore/build/local-derivation-goal.cc)
   693 ms: nix::daemon::performOp(nix::daemon::TunnelLogger*, nix::ref<nix::Sto... (../src/libstore/daemon.cc)
   658 ms: nix::LocalStore::LocalStore(std::map<std::__cxx11::basic_string<char... (../src/libstore/local-store.cc)
   532 ms: main_nix_build(int, char**) (../src/nix-build/nix-build.cc)
   479 ms: nix::fetchers::MercurialInputScheme::fetch(nix::ref<nix::Store>, nix... (../src/libfetchers/mercurial.cc)
   458 ms: nix::LocalDerivationGoal::registerOutputs[abi:cxx11]() (../src/libstore/build/local-derivation-goal.cc)
   394 ms: opQuery(Globals&, std::__cxx11::list<std::__cxx11::basic_string<char... (../src/nix-env/nix-env.cc)
   353 ms: nix::NixArgs::NixArgs() (../src/nix/main.cc)
   327 ms: nix::parseFlakeRefWithFragment(std::__cxx11::basic_string<char, std:... (../src/libexpr/flake/flakeref.cc)
   318 ms: nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::fl... (../src/libexpr/flake/flake.cc)
   306 ms: nix::derivationStrictInternal(nix::EvalState&, std::__cxx11::basic_s... (../src/libexpr/primops.cc)
   297 ms: main_build_remote(int, char**) (../src/build-remote/build-remote.cc)
   290 ms: _GLOBAL__sub_I_url.cc (../src/libutil/url.cc)
   290 ms: toml::result<bool, std::__cxx11::basic_string<char, std::char_traits... (../src/libexpr/primops/fromTOML.cc)
   261 ms: nix::BinaryCacheStore::addToStoreCommon(nix::Source&, nix::RepairFla... (../src/libstore/binary-cache-store.cc)
   253 ms: nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::fl... (../src/libexpr/flake/flake.cc)
   248 ms: CmdDevelop::run(nix::ref<nix::Store>, nix::ref<nix::Installable>) (../src/nix/develop.cc)
   246 ms: CmdBuild::run(nix::ref<nix::Store>, std::vector<nix::ref<nix::Instal... (../src/nix/build.cc)
   245 ms: nix::LocalStore::collectGarbage(nix::GCOptions const&, nix::GCResult... (../src/libstore/gc.cc)
   237 ms: _GLOBAL__sub_I_github.cc (../src/libfetchers/github.cc)
   236 ms: yyuserAction(int, int, yyGLRStackItem*, yyGLRStack*, long, YYSTYPE*,... (src/libexpr/parser-tab.cc)
   236 ms: nix::LocalDerivationGoal::runChild() (../src/libstore/build/local-derivation-goal.cc)
   223 ms: nix::NixRepl::processLine(std::__cxx11::basic_string<char, std::char... (../src/libcmd/repl.cc)
   221 ms: nix::prim_fetchClosure(nix::EvalState&, nix::PosIdx, nix::Value**, n... (../src/libexpr/primops/fetchClosure.cc)
   217 ms: nix::EvalState::printStatistics() (../src/libexpr/eval.cc)
   217 ms: toml::detail::parse_ml_basic_string[abi:cxx11](toml::detail::locatio... (../src/libexpr/primops/fromTOML.cc)
   217 ms: nix::Installable::build2(nix::ref<nix::Store>, nix::ref<nix::Store>,... (../src/libcmd/installables.cc)

**** Function sets that took longest to compile / optimize:
  9358 ms: std::vector<$>::_M_fill_insert(__gnu_cxx::__normal_iterator<$>, unsi... (173 times, avg 54 ms)
  8698 ms: bool boost::io::detail::parse_printf_directive<$>(__gnu_cxx::__norma... (173 times, avg 50 ms)
  7443 ms: void boost::io::detail::put<$>(boost::io::detail::put_holder<$> cons... (173 times, avg 43 ms)
  5071 ms: boost::basic_format<$>::parse(std::__cxx11::basic_string<$> const&) (173 times, avg 29 ms)
  4926 ms: std::vector<$>::_M_fill_insert(std::_Bit_iterator, unsigned long, bo... (173 times, avg 28 ms)
  3941 ms: non-virtual thunk to boost::wrapexcept<$>::~wrapexcept() (499 times, avg 7 ms)
  3530 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (1150 times, avg 3 ms)
  3188 ms: std::vector<$>::_M_fill_assign(unsigned long, boost::io::detail::for... (173 times, avg 18 ms)
  2970 ms: boost::basic_format<$>::str[abi:cxx11]() const (130 times, avg 22 ms)
  2912 ms: void boost::io::detail::mk_str<$>(std::__cxx11::basic_string<$>&, ch... (173 times, avg 16 ms)
  2404 ms: bool std::__detail::_Compiler<$>::_M_expression_term<$>(std::__detai... (88 times, avg 27 ms)
  2376 ms: boost::basic_format<$>::make_or_reuse_data(unsigned long) (173 times, avg 13 ms)
  1982 ms: boost::wrapexcept<$>::~wrapexcept() (499 times, avg 3 ms)
  1928 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (178 times, avg 10 ms)
  1866 ms: toml::result<$> toml::detail::sequence<$>::invoke<$>(toml::detail::l... (93 times, avg 20 ms)
  1848 ms: std::__cxx11::basic_string<$>::_M_replace(unsigned long, unsigned lo... (181 times, avg 10 ms)
  1790 ms: std::vector<$>::~vector() (497 times, avg 3 ms)
  1780 ms: nix::fetchers::GitInputScheme::fetch(nix::ref<$>, nix::fetchers::Inp... (1 times, avg 1780 ms)
  1681 ms: boost::wrapexcept<$>::clone() const (499 times, avg 3 ms)
  1672 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (230 times, avg 7 ms)
  1588 ms: int boost::io::detail::upper_bound_from_fstring<$>(std::__cxx11::bas... (173 times, avg 9 ms)
  1565 ms: boost::io::detail::format_item<char, std::char_traits<char>, std::al... (173 times, avg 9 ms)
  1510 ms: std::_Function_handler<$>::_M_manager(std::_Any_data&, std::_Any_dat... (883 times, avg 1 ms)
  1486 ms: nlohmann::json_abi_v3_11_2::detail::serializer<$>::dump(nlohmann::js... (34 times, avg 43 ms)
  1461 ms: boost::io::basic_altstringbuf<$>::overflow(int) (173 times, avg 8 ms)
  1437 ms: std::vector<$>::vector(std::vector<$> const&) (186 times, avg 7 ms)
  1407 ms: std::_Rb_tree<$>::_M_get_insert_unique_pos(std::__cxx11::basic_strin... (236 times, avg 5 ms)
  1353 ms: std::_Rb_tree_node<$>* std::_Rb_tree<$>::_M_copy<$>(std::_Rb_tree_no... (257 times, avg 5 ms)
  1344 ms: std::__shared_ptr<$>::~__shared_ptr() (493 times, avg 2 ms)
  1319 ms: boost::basic_format<$>::basic_format(boost::basic_format<$> const&) (148 times, avg 8 ms)

**** Expensive headers:
448872 ms: ../src/libutil/util.hh (included 198 times, avg 2267 ms), included via:
  38x: command.hh installable-value.hh installables.hh 
  21x: <direct include>
  13x: globals.hh 
  7x: serialise.hh 
  6x: fetchers.hh hash.hh serialise.hh 
  6x: archive.hh serialise.hh 
  ...

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

208234 ms: ../src/libcmd/installables.hh (included 53 times, avg 3928 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 
  ...

202094 ms: ../src/libutil/config.hh (included 198 times, avg 1020 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh logging.hh 
  18x: util.hh logging.hh 
  13x: globals.hh 
  7x: serialise.hh util.hh logging.hh 
  6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh 
  6x: archive.hh serialise.hh util.hh logging.hh 
  ...

193736 ms: ../src/libutil/experimental-features.hh (included 198 times, avg 978 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh 
  17x: util.hh logging.hh config.hh 
  13x: globals.hh config.hh 
  7x: serialise.hh util.hh logging.hh config.hh 
  6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh 
  6x: archive.hh serialise.hh util.hh logging.hh config.hh 
  ...

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

186953 ms: /nix/store/akhgrxsgq7wmm6cyn6dgfpnq3l03gws4-nlohmann_json-3.11.2/include/nlohmann/json.hpp (included 199 times, avg 939 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 
  16x: util.hh logging.hh config.hh experimental-features.hh json-utils.hh 
  13x: globals.hh config.hh experimental-features.hh json-utils.hh 
  7x: serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 
  6x: archive.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 
  6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 
  ...

185114 ms: ../src/libutil/json-utils.hh (included 199 times, avg 930 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh experimental-features.hh 
  17x: util.hh logging.hh config.hh experimental-features.hh 
  13x: globals.hh config.hh experimental-features.hh 
  7x: serialise.hh util.hh logging.hh config.hh experimental-features.hh 
  6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh 
  6x: archive.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh 
  ...

184609 ms: ../src/libutil/logging.hh (included 198 times, avg 932 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh 
  18x: util.hh 
  13x: globals.hh util.hh 
  7x: serialise.hh util.hh 
  6x: fetchers.hh hash.hh serialise.hh util.hh 
  6x: archive.hh serialise.hh util.hh 
  ...

172599 ms: ../src/libutil/types.hh (included 200 times, avg 862 ms), included via:
  38x: command.hh installable-value.hh installables.hh util.hh 
  10x: globals.hh 
  7x: util.hh 
  7x: serialise.hh 
  6x: fetchers.hh 
  5x: archive.hh 
  ...

  done in 0.4s.
So, given that we have a meson build, I took the opportunity to dump `-ftime-trace` into the clang args, and then dumped the whole thing into ClangBuildAnalyzer. Here is the report. I suspect we might be able to chop a lot of silliness off of it. ``` lix/lix » ClangBuildAnalyzer --analyze capture.bin change-580 Analyzing build trace from 'capture.bin'... **** Time summary: Compilation (410 times): Parsing (frontend): 1382.5 s Codegen & opts (backend): 859.5 s **** Files that took longest to parse (compiler frontend): 10543 ms: build/src/nix/nix.p/flake.cc.o 10189 ms: build/src/nix/nix.p/profile.cc.o 10173 ms: build/src/libexpr/libnixexpr.so.p/eval.cc.o 9934 ms: build/src/libexpr/libnixexpr.so.p/primops.cc.o 9796 ms: build/src/libstore/libnixstore.so.p/derivations.cc.o 9491 ms: build/src/libstore/libnixstore.so.p/build_local-derivation-goal.cc.o 9485 ms: build/src/libstore/libnixstore.so.p/s3-binary-cache-store.cc.o 9367 ms: build/src/nix/nix.p/search.cc.o 9333 ms: build/src/libcmd/libnixcmd.so.p/installables.cc.o 9167 ms: build/src/libstore/libnixstore.so.p/store-api.cc.o **** Files that took longest to codegen (compiler backend): 24663 ms: build/src/libexpr/libnixexpr.so.p/primops_fromTOML.cc.o 22896 ms: build/src/libexpr/libnixexpr.so.p/primops.cc.o 21343 ms: build/src/libstore/libnixstore.so.p/build_local-derivation-goal.cc.o 16706 ms: build/src/libstore/libnixstore.so.p/store-api.cc.o 15053 ms: build/src/libstore/libnixstore.so.p/binary-cache-store.cc.o 13761 ms: build/src/libexpr/libnixexpr.so.p/eval.cc.o 12275 ms: build/src/libstore/libnixstore.so.p/gc.cc.o 12236 ms: build/src/nix/nix.p/develop.cc.o 12059 ms: build/src/libfetchers/libnixfetchers.so.p/github.cc.o 11278 ms: build/src/libstore/libnixstore.so.p/build_derivation-goal.cc.o **** Templates that took longest to instantiate: 132524 ms: nlohmann::basic_json<>::parse<const char *> (199 times, avg 665 ms) 90235 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 453 ms) 78626 ms: nlohmann::basic_json<>::basic_json (807 times, avg 97 ms) 71325 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 358 ms) 51173 ms: nlohmann::basic_json<>::json_value::json_value (1019 times, avg 50 ms) 29994 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 150 ms) 22101 ms: nix::HintFmt::HintFmt<nix::Uncolored<std::basic_string<char>>> (398 times, avg 55 ms) 16991 ms: boost::basic_format<char>::basic_format (398 times, avg 42 ms) 14421 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 72 ms) 13702 ms: boost::basic_format<char>::parse (199 times, avg 68 ms) 10931 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_poi... (199 times, avg 54 ms) 10881 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms) 10840 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms) 10796 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 54 ms) 10759 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<nlohmann::d... (199 times, avg 54 ms) 10730 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms) 10699 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms) 10671 ms: nlohmann::detail::conjunction<nlohmann::detail::negation<std::is_sam... (199 times, avg 53 ms) 10629 ms: nlohmann::detail::conjunction<nlohmann::detail::is_detected_lazy<nlo... (199 times, avg 53 ms) 10626 ms: nlohmann::detail::is_detected_lazy<nlohmann::detail::get_template_fu... (199 times, avg 53 ms) 10259 ms: nlohmann::detail::parser<nlohmann::basic_json<>, nlohmann::detail::i... (199 times, avg 51 ms) 10031 ms: std::basic_regex<char>::_M_compile (22 times, avg 455 ms) 9600 ms: std::__detail::_Compiler<std::regex_traits<char>>::_Compiler (22 times, avg 436 ms) 9328 ms: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<... (199 times, avg 46 ms) 9112 ms: nlohmann::basic_json<>::create<std::map<std::basic_string<char>, nlo... (199 times, avg 45 ms) 8551 ms: nlohmann::detail::external_constructor<nlohmann::detail::value_t::st... (218 times, avg 39 ms) 8362 ms: nlohmann::basic_json<>::basic_json<std::basic_string<char> &, std::b... (199 times, avg 42 ms) 8320 ms: nlohmann::adl_serializer<std::basic_string<char>>::to_json<nlohmann:... (199 times, avg 41 ms) 8293 ms: nlohmann::detail::to_json_fn::operator()<nlohmann::basic_json<>, std... (199 times, avg 41 ms) 8153 ms: std::__detail::_Compiler<std::regex_traits<char>>::_M_disjunction (22 times, avg 370 ms) **** Template sets that took longest to instantiate: 132975 ms: nlohmann::basic_json<$>::parse<$> (213 times, avg 624 ms) 90453 ms: nlohmann::detail::parser<$>::parse (212 times, avg 426 ms) 81726 ms: nlohmann::detail::parser<$>::sax_parse_internal<$> (425 times, avg 192 ms) 53666 ms: nlohmann::basic_json<$>::basic_json (626 times, avg 85 ms) 52698 ms: nlohmann::basic_json<$>::create<$> (1705 times, avg 30 ms) 51173 ms: nlohmann::basic_json<$>::json_value::json_value (1019 times, avg 50 ms) 49996 ms: std::__do_visit<$> (3180 times, avg 15 ms) 42856 ms: std::__detail::__variant::__gen_vtable_impl<$>::__visit_invoke (9866 times, avg 4 ms) 38600 ms: std::__detail::__variant::__raw_idx_visit<$> (2144 times, avg 18 ms) 35701 ms: std::unique_ptr<$> (2601 times, avg 13 ms) 30921 ms: std::__and_<$> (25572 times, avg 1 ms) 29994 ms: nlohmann::detail::json_sax_dom_callback_parser<$>::end_object (199 times, avg 150 ms) 29657 ms: std::__uniq_ptr_data<$> (2601 times, avg 11 ms) 29298 ms: std::__uniq_ptr_impl<$> (2601 times, avg 11 ms) 27386 ms: nlohmann::detail::conjunction<$> (1264 times, avg 21 ms) 26090 ms: std::tuple<$> (5531 times, avg 4 ms) 25850 ms: std::__tuple_compare<$>::__eq (2587 times, avg 9 ms) 25730 ms: std::allocator_traits<$>::construct<$> (7634 times, avg 3 ms) 25679 ms: nlohmann::detail::is_detected_lazy<$> (1028 times, avg 24 ms) 24903 ms: std::variant<$> (1722 times, avg 14 ms) 24022 ms: std::__invoke_result<$> (9380 times, avg 2 ms) 22363 ms: std::optional<$> (2563 times, avg 8 ms) 21805 ms: std::__result_of_impl<$> (7876 times, avg 2 ms) 21588 ms: nix::HintFmt::HintFmt<$> (706 times, avg 30 ms) 20988 ms: std::__or_<$> (24658 times, avg 0 ms) 19773 ms: std::pair<$> (4601 times, avg 4 ms) 19668 ms: std::_Rb_tree<$>::~_Rb_tree (2156 times, avg 9 ms) 19242 ms: std::_Rb_tree<$>::_M_erase (2180 times, avg 8 ms) 18637 ms: std::tie<$> (2549 times, avg 7 ms) 18402 ms: nlohmann::detail::json_sax_dom_callback_parser<$>::handle_value<$> (1393 times, avg 13 ms) **** Functions that took longest to compile: 1780 ms: nix::fetchers::GitInputScheme::fetch(nix::ref<nix::Store>, nix::fetc... (../src/libfetchers/git.cc) 1599 ms: _GLOBAL__sub_I_primops.cc (../src/libexpr/primops.cc) 1248 ms: nix::Settings::Settings() (../src/libstore/globals.cc) 967 ms: nix::LocalDerivationGoal::startBuilder() (../src/libstore/build/local-derivation-goal.cc) 693 ms: nix::daemon::performOp(nix::daemon::TunnelLogger*, nix::ref<nix::Sto... (../src/libstore/daemon.cc) 658 ms: nix::LocalStore::LocalStore(std::map<std::__cxx11::basic_string<char... (../src/libstore/local-store.cc) 532 ms: main_nix_build(int, char**) (../src/nix-build/nix-build.cc) 479 ms: nix::fetchers::MercurialInputScheme::fetch(nix::ref<nix::Store>, nix... (../src/libfetchers/mercurial.cc) 458 ms: nix::LocalDerivationGoal::registerOutputs[abi:cxx11]() (../src/libstore/build/local-derivation-goal.cc) 394 ms: opQuery(Globals&, std::__cxx11::list<std::__cxx11::basic_string<char... (../src/nix-env/nix-env.cc) 353 ms: nix::NixArgs::NixArgs() (../src/nix/main.cc) 327 ms: nix::parseFlakeRefWithFragment(std::__cxx11::basic_string<char, std:... (../src/libexpr/flake/flakeref.cc) 318 ms: nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::fl... (../src/libexpr/flake/flake.cc) 306 ms: nix::derivationStrictInternal(nix::EvalState&, std::__cxx11::basic_s... (../src/libexpr/primops.cc) 297 ms: main_build_remote(int, char**) (../src/build-remote/build-remote.cc) 290 ms: _GLOBAL__sub_I_url.cc (../src/libutil/url.cc) 290 ms: toml::result<bool, std::__cxx11::basic_string<char, std::char_traits... (../src/libexpr/primops/fromTOML.cc) 261 ms: nix::BinaryCacheStore::addToStoreCommon(nix::Source&, nix::RepairFla... (../src/libstore/binary-cache-store.cc) 253 ms: nix::flake::lockFlake(nix::EvalState&, nix::FlakeRef const&, nix::fl... (../src/libexpr/flake/flake.cc) 248 ms: CmdDevelop::run(nix::ref<nix::Store>, nix::ref<nix::Installable>) (../src/nix/develop.cc) 246 ms: CmdBuild::run(nix::ref<nix::Store>, std::vector<nix::ref<nix::Instal... (../src/nix/build.cc) 245 ms: nix::LocalStore::collectGarbage(nix::GCOptions const&, nix::GCResult... (../src/libstore/gc.cc) 237 ms: _GLOBAL__sub_I_github.cc (../src/libfetchers/github.cc) 236 ms: yyuserAction(int, int, yyGLRStackItem*, yyGLRStack*, long, YYSTYPE*,... (src/libexpr/parser-tab.cc) 236 ms: nix::LocalDerivationGoal::runChild() (../src/libstore/build/local-derivation-goal.cc) 223 ms: nix::NixRepl::processLine(std::__cxx11::basic_string<char, std::char... (../src/libcmd/repl.cc) 221 ms: nix::prim_fetchClosure(nix::EvalState&, nix::PosIdx, nix::Value**, n... (../src/libexpr/primops/fetchClosure.cc) 217 ms: nix::EvalState::printStatistics() (../src/libexpr/eval.cc) 217 ms: toml::detail::parse_ml_basic_string[abi:cxx11](toml::detail::locatio... (../src/libexpr/primops/fromTOML.cc) 217 ms: nix::Installable::build2(nix::ref<nix::Store>, nix::ref<nix::Store>,... (../src/libcmd/installables.cc) **** Function sets that took longest to compile / optimize: 9358 ms: std::vector<$>::_M_fill_insert(__gnu_cxx::__normal_iterator<$>, unsi... (173 times, avg 54 ms) 8698 ms: bool boost::io::detail::parse_printf_directive<$>(__gnu_cxx::__norma... (173 times, avg 50 ms) 7443 ms: void boost::io::detail::put<$>(boost::io::detail::put_holder<$> cons... (173 times, avg 43 ms) 5071 ms: boost::basic_format<$>::parse(std::__cxx11::basic_string<$> const&) (173 times, avg 29 ms) 4926 ms: std::vector<$>::_M_fill_insert(std::_Bit_iterator, unsigned long, bo... (173 times, avg 28 ms) 3941 ms: non-virtual thunk to boost::wrapexcept<$>::~wrapexcept() (499 times, avg 7 ms) 3530 ms: std::_Rb_tree<$>::_M_erase(std::_Rb_tree_node<$>*) (1150 times, avg 3 ms) 3188 ms: std::vector<$>::_M_fill_assign(unsigned long, boost::io::detail::for... (173 times, avg 18 ms) 2970 ms: boost::basic_format<$>::str[abi:cxx11]() const (130 times, avg 22 ms) 2912 ms: void boost::io::detail::mk_str<$>(std::__cxx11::basic_string<$>&, ch... (173 times, avg 16 ms) 2404 ms: bool std::__detail::_Compiler<$>::_M_expression_term<$>(std::__detai... (88 times, avg 27 ms) 2376 ms: boost::basic_format<$>::make_or_reuse_data(unsigned long) (173 times, avg 13 ms) 1982 ms: boost::wrapexcept<$>::~wrapexcept() (499 times, avg 3 ms) 1928 ms: std::_Rb_tree<$>::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_... (178 times, avg 10 ms) 1866 ms: toml::result<$> toml::detail::sequence<$>::invoke<$>(toml::detail::l... (93 times, avg 20 ms) 1848 ms: std::__cxx11::basic_string<$>::_M_replace(unsigned long, unsigned lo... (181 times, avg 10 ms) 1790 ms: std::vector<$>::~vector() (497 times, avg 3 ms) 1780 ms: nix::fetchers::GitInputScheme::fetch(nix::ref<$>, nix::fetchers::Inp... (1 times, avg 1780 ms) 1681 ms: boost::wrapexcept<$>::clone() const (499 times, avg 3 ms) 1672 ms: std::_Rb_tree_iterator<$> std::_Rb_tree<$>::_M_emplace_hint_unique<$... (230 times, avg 7 ms) 1588 ms: int boost::io::detail::upper_bound_from_fstring<$>(std::__cxx11::bas... (173 times, avg 9 ms) 1565 ms: boost::io::detail::format_item<char, std::char_traits<char>, std::al... (173 times, avg 9 ms) 1510 ms: std::_Function_handler<$>::_M_manager(std::_Any_data&, std::_Any_dat... (883 times, avg 1 ms) 1486 ms: nlohmann::json_abi_v3_11_2::detail::serializer<$>::dump(nlohmann::js... (34 times, avg 43 ms) 1461 ms: boost::io::basic_altstringbuf<$>::overflow(int) (173 times, avg 8 ms) 1437 ms: std::vector<$>::vector(std::vector<$> const&) (186 times, avg 7 ms) 1407 ms: std::_Rb_tree<$>::_M_get_insert_unique_pos(std::__cxx11::basic_strin... (236 times, avg 5 ms) 1353 ms: std::_Rb_tree_node<$>* std::_Rb_tree<$>::_M_copy<$>(std::_Rb_tree_no... (257 times, avg 5 ms) 1344 ms: std::__shared_ptr<$>::~__shared_ptr() (493 times, avg 2 ms) 1319 ms: boost::basic_format<$>::basic_format(boost::basic_format<$> const&) (148 times, avg 8 ms) **** Expensive headers: 448872 ms: ../src/libutil/util.hh (included 198 times, avg 2267 ms), included via: 38x: command.hh installable-value.hh installables.hh 21x: <direct include> 13x: globals.hh 7x: serialise.hh 6x: fetchers.hh hash.hh serialise.hh 6x: archive.hh serialise.hh ... 217615 ms: ../src/libcmd/installable-value.hh (included 52 times, avg 4184 ms), included via: 40x: command.hh 5x: command-installable-value.hh 3x: installable-flake.hh 2x: <direct include> 2x: installable-attr-path.hh 208234 ms: ../src/libcmd/installables.hh (included 53 times, avg 3928 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 ... 202094 ms: ../src/libutil/config.hh (included 198 times, avg 1020 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh logging.hh 18x: util.hh logging.hh 13x: globals.hh 7x: serialise.hh util.hh logging.hh 6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh 6x: archive.hh serialise.hh util.hh logging.hh ... 193736 ms: ../src/libutil/experimental-features.hh (included 198 times, avg 978 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh 17x: util.hh logging.hh config.hh 13x: globals.hh config.hh 7x: serialise.hh util.hh logging.hh config.hh 6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh 6x: archive.hh serialise.hh util.hh logging.hh config.hh ... 193123 ms: ../src/libcmd/command.hh (included 51 times, avg 3786 ms), included via: 42x: <direct include> 7x: command-installable-value.hh 2x: installable-attr-path.hh 186953 ms: /nix/store/akhgrxsgq7wmm6cyn6dgfpnq3l03gws4-nlohmann_json-3.11.2/include/nlohmann/json.hpp (included 199 times, avg 939 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 16x: util.hh logging.hh config.hh experimental-features.hh json-utils.hh 13x: globals.hh config.hh experimental-features.hh json-utils.hh 7x: serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 6x: archive.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh 6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh json-utils.hh ... 185114 ms: ../src/libutil/json-utils.hh (included 199 times, avg 930 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh logging.hh config.hh experimental-features.hh 17x: util.hh logging.hh config.hh experimental-features.hh 13x: globals.hh config.hh experimental-features.hh 7x: serialise.hh util.hh logging.hh config.hh experimental-features.hh 6x: fetchers.hh hash.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh 6x: archive.hh serialise.hh util.hh logging.hh config.hh experimental-features.hh ... 184609 ms: ../src/libutil/logging.hh (included 198 times, avg 932 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh 18x: util.hh 13x: globals.hh util.hh 7x: serialise.hh util.hh 6x: fetchers.hh hash.hh serialise.hh util.hh 6x: archive.hh serialise.hh util.hh ... 172599 ms: ../src/libutil/types.hh (included 200 times, avg 862 ms), included via: 38x: command.hh installable-value.hh installables.hh util.hh 10x: globals.hh 7x: util.hh 7x: serialise.hh 6x: fetchers.hh 5x: archive.hh ... done in 0.4s. ```
jade added the
devx
label 2024-03-19 04:58:33 +00:00
Owner

Also lets track adding this to CI here and keeping track of the performance of builds over time

Also lets track adding this to CI here and keeping track of the performance of builds over time
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#159
No description provided.