mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22: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:
parent
e392ff53e9
commit
2160258cc4
8 changed files with 78 additions and 37 deletions
|
|
@ -27,7 +27,7 @@ void printValueAsJSON(EvalState & state, bool strict,
|
|||
break;
|
||||
|
||||
case tString:
|
||||
copyContext(v, context);
|
||||
v.getContext(context);
|
||||
out.write(v.string.s);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue