1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00

Store contexts as symbols

This provides some deduplication since most contexts are used multiple
times.

Also, store singleton contexts directly in the Value object. This
saves a 16-byte Context object. This is useful because the vast
majority of contexts are singletons, e.g. 23723 out of 26138 in a
NixOS 19.03 system configuration.
This commit is contained in:
Eelco Dolstra 2019-04-23 11:07:47 +02:00
parent e392ff53e9
commit 2160258cc4
8 changed files with 78 additions and 37 deletions

View file

@ -70,7 +70,7 @@ static void printValueAsXML(EvalState & state, bool strict, bool location,
case tString:
/* !!! show the context? */
copyContext(v, context);
v.getContext(context);
doc.writeEmptyElement("string", singletonAttrs("value", v.string.s));
break;