Skip to content

Commit

Permalink
Flatten the Nix strings on the fly
Browse files Browse the repository at this point in the history
Reduces the size of the generated json by ~300%, and causes a ~1.6x
speedup in the Nickel evaluation time
  • Loading branch information
Théophane Hufschmitt committed Jun 26, 2024
1 parent 0100a9d commit bd88905
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/nix-interop/derivation.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ in
mk_nix_string [value]
else
let { fragments, .. } = std.contract.apply NixSymbolicString label value in
mk_nix_string fragments,
mk_nix_string
(
std.array.flat_map
(fun elt => elt.fragments)
fragments
),

NixDerivation
| doc m%"
Expand Down

0 comments on commit bd88905

Please sign in to comment.