mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 19:51:00 +01:00
libfetchers: Improve compile times with PCH
(Before) **** Time summary: Compilation (17 times): Parsing (frontend): 72.3 s Codegen & opts (backend): 47.8 s (After) Compilation (19 times): Parsing (frontend): 27.5 s Codegen & opts (backend): 43.8 s
This commit is contained in:
parent
f13aeaf2f1
commit
347ed8d9ba
3 changed files with 5 additions and 1 deletions
|
|
@ -292,7 +292,7 @@ void Fetch::fetch(
|
|||
auto authIt = headerIt->find("Authorization");
|
||||
if (authIt == headerIt->end())
|
||||
return std::nullopt;
|
||||
return *authIt;
|
||||
return std::string(*authIt);
|
||||
}();
|
||||
const uint64_t size = obj.at("size");
|
||||
sizeCallback(size);
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ this_library = library(
|
|||
link_args : linker_export_flags,
|
||||
prelink : true, # For C++ static initializers
|
||||
install : true,
|
||||
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
|
||||
)
|
||||
|
||||
install_headers(headers, subdir : 'nix/fetchers', preserve_path : true)
|
||||
|
|
|
|||
3
src/libfetchers/pch/precompiled-headers.hh
Normal file
3
src/libfetchers/pch/precompiled-headers.hh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "nix/fetchers/fetchers.hh"
|
||||
#include "nix/store/store-api.hh"
|
||||
#include "nix/util/json-utils.hh"
|
||||
Loading…
Add table
Add a link
Reference in a new issue