From 00c993f48b1c752656d8cdd2c25e38f9ba572128 Mon Sep 17 00:00:00 2001 From: pennae Date: Sat, 25 Dec 2021 15:29:49 +0100 Subject: add zipAttrsWith primop nixpkgs can save a good bit of eval memory with this primop. zipAttrsWith is used quite a bit around nixpkgs (eg in the form of recursiveUpdate), but the most costly application for this primop is in the module system. it improves the implementation of zipAttrsWith from nixpkgs by not checking an attribute multiple times if it occurs more than once in the input list, allocates less values and set elements, and just avoids many a temporary object in general. nixpkgs has a more generic version of this operation, zipAttrsWithNames, but this version is only used once so isn't suitable for being the base of a new primop. if it were to be used more we should add a second primop instead. --- doc/manual/src/release-notes/rl-next.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/manual/src') diff --git a/doc/manual/src/release-notes/rl-next.md b/doc/manual/src/release-notes/rl-next.md index 2a67a39b1..a516887b1 100644 --- a/doc/manual/src/release-notes/rl-next.md +++ b/doc/manual/src/release-notes/rl-next.md @@ -4,3 +4,5 @@ more compliant one](https://github.com/ToruNiina/toml11). * Added `:st`/`:show-trace` commands to nix repl, which are used to set or toggle display of error traces. +* New builtin function `builtins.zipAttrsWith` with same functionality + as `lib.zipAttrsWith` from nixpkgs, but much more efficient. -- cgit v1.2.3