lix/src/libstore
Sergei Trofimovich d58453f72e gc: don't visit implicit referrers on garbage collection
Before the change garbage collector was not considering
`.drv` and outputs as alive even if configuration says otherwise.
As a result `nix store gc --dry-run` could visit (and parse)
`.drv` files multiple times (worst case it's quadratic).

It happens because `alive` set was populating only runtime closure
without regard for actual configuration. The change fixes it.

Benchmark: my system has about 139MB, 40K `.drv` files.

Performance before the change:

    $ time nix store gc --dry-run
    real    4m22,148s

Performance after the change:

    $ time nix store gc --dry-run
    real    0m14,178s
2022-03-17 18:47:29 +00:00
..
build Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
builtins Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
tests
binary-cache-store.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
binary-cache-store.hh Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
build-result.hh BuildResult: Remove unused drvPath field 2022-03-09 20:31:50 +01:00
builtins.hh
ca-specific-schema.sql
content-address.cc
content-address.hh
crypto.cc
crypto.hh
daemon.cc Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
daemon.hh
derivations.cc Reduce variants for derivation hash modulo 2022-03-11 21:20:37 +00:00
derivations.hh Reduce variants for derivation hash modulo 2022-03-11 21:20:37 +00:00
derived-path.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
derived-path.hh
dummy-store.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
export-import.cc
filetransfer.cc Fix segfault in headerCallback() 2022-03-03 11:11:16 +01:00
filetransfer.hh Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
fs-accessor.hh
gc-store.hh Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
gc.cc gc: don't visit implicit referrers on garbage collection 2022-03-17 18:47:29 +00:00
globals.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
globals.hh Move some stuff from Settings to a new FetchSettings. 2022-03-01 01:39:25 +00:00
http-binary-cache-store.cc
legacy-ssh-store.cc BuildResult: Use DerivedPath 2022-03-09 12:25:35 +01:00
local-binary-cache-store.cc
local-fs-store.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
local-fs-store.hh Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
local-store.cc Reduce variants for derivation hash modulo 2022-03-11 21:20:37 +00:00
local-store.hh Factor out a GcStore interface 2022-03-03 19:01:25 +00:00
local.mk
lock.cc
lock.hh Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
log-store.hh Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
machines.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
machines.hh
misc.cc
names.cc
names.hh
nar-accessor.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nar-accessor.hh
nar-info-disk-cache.cc
nar-info-disk-cache.hh
nar-info.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
nar-info.hh
nix-store.pc.in
optimise-store.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
parsed-derivations.cc
parsed-derivations.hh
path-info.cc
path-info.hh
path-with-outputs.cc Factor out a GcStore interface 2022-03-03 19:01:25 +00:00
path-with-outputs.hh
path.cc
path.hh Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
pathlocks.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
pathlocks.hh Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
profiles.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
profiles.hh Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
realisation.cc
realisation.hh
references.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
references.hh
remote-fs-accessor.cc
remote-fs-accessor.hh
remote-store.cc BuildResult: Use DerivedPath 2022-03-09 12:25:35 +01:00
remote-store.hh Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
s3-binary-cache-store.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
s3-binary-cache-store.hh
s3.hh
sandbox-defaults.sb
sandbox-minimal.sb
sandbox-network.sb
schema.sql
serve-protocol.hh
sqlite.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
sqlite.hh
ssh-store.cc Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
ssh.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
ssh.hh
store-api.cc Remove std::string alias (for real this time) 2022-02-25 16:13:02 +01:00
store-api.hh Factor out a LogStore interface 2022-03-11 13:32:16 +00:00
store-cast.hh Deduplicate the Store downcasting with a template 2022-03-11 13:32:33 +00:00
uds-remote-store.cc
uds-remote-store.hh
worker-protocol.hh Add Store::buildPathsWithResults() 2022-03-08 19:56:34 +01:00