* Store attribute sets as a vector instead of a map (i.e. a red-black
tree). This saves a lot of memory. The vector should be sorted so
that names can be looked up using binary search, but this is not the
case yet. (Surprisingly, looking up attributes using linear search
doesn't have a big impact on performance.)
Memory consumption for
$ nix-instantiate /etc/nixos/nixos/tests -A bittorrent.test --readonly-mode
on x86_64-linux with GC enabled is now 185 MiB (compared to 946
MiB on the trunk).
This commit is contained in:
parent
a247d20604
commit
0b305c534f
7 changed files with 129 additions and 90 deletions
|
|
@ -49,7 +49,7 @@ void findAlongAttrPath(EvalState & state, const string & attrPath,
|
|||
Bindings::iterator a = v.attrs->find(state.symbols.create(attr));
|
||||
if (a == v.attrs->end())
|
||||
throw Error(format("attribute `%1%' in selection path `%2%' not found") % attr % curPath);
|
||||
v = *a->second.value;
|
||||
v = *a->value;
|
||||
}
|
||||
|
||||
else if (apType == apIndex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue