mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Move path info caching from BinaryCacheStore to Store
Caching path info is generally useful. For instance, it speeds up "nix path-info -rS /run/current-system" (i.e. showing the closure sizes of all paths in the closure of the current system) from 5.6s to 0.15s. This also eliminates some APIs like Store::queryDeriver() and Store::queryReferences().
This commit is contained in:
parent
608b0265e1
commit
e0204f8d46
21 changed files with 318 additions and 353 deletions
|
@ -110,19 +110,13 @@ void printDotGraph(ref<Store> store, const PathSet & roots)
|
|||
|
||||
cout << makeNode(path, symbolicName(path), "#ff0000");
|
||||
|
||||
PathSet references;
|
||||
store->queryReferences(path, references);
|
||||
|
||||
for (PathSet::iterator i = references.begin();
|
||||
i != references.end(); ++i)
|
||||
{
|
||||
if (*i != path) {
|
||||
workList.insert(*i);
|
||||
cout << makeEdge(*i, path);
|
||||
for (auto & p : store->queryPathInfo(path)->references) {
|
||||
if (p != path) {
|
||||
workList.insert(p);
|
||||
cout << makeEdge(p, path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
StoreExpr ne = storeExprFromPath(path);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue