mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 07:22:43 +01:00
Store short strings in Values
The vast majority of strings are < 16 bytes, and so can be stored directly in a Value. This saves a heap allocation and an indirection.
This commit is contained in:
parent
2160258cc4
commit
742a8046de
10 changed files with 107 additions and 78 deletions
|
|
@ -26,9 +26,10 @@ void printValueAsJSON(EvalState & state, bool strict,
|
|||
out.write(v.boolean);
|
||||
break;
|
||||
|
||||
case tString:
|
||||
case tShortString:
|
||||
case tLongString:
|
||||
v.getContext(context);
|
||||
out.write(v.string.s);
|
||||
out.write(v.getString());
|
||||
break;
|
||||
|
||||
case tPath:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue