Merged
Conversation
52 tasks
Co-authored-by: Silvan Mosberger <[email protected]>
cd68034 to
83e1488
Compare
`filter` is a primop which is designed for this task, and it saves the allocation of some singleton lists here.
roberth
approved these changes
Oct 31, 2024
infinisil
approved these changes
Nov 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Small optimization. Instead of having
filterAttrscollect values and merge them, it only collects the names of the unwanted attributes and passes them toremoveAttrs. This leads to slightly less memory copied around. Also added a testNIX_SHOW_STATS=1 nix flake checkbefore{ "cpuTime": 10.154743194580078, "envs": { "bytes": 693836664, "elements": 35023599, "number": 25852992 }, "gc": { "heapSize": 789245952, "totalBytes": 3407736128 }, "list": { "bytes": 60538296, "concats": 866078, "elements": 7567287 }, "nrAvoided": 28680092, "nrFunctionCalls": 23458684, "nrLookups": 11705269, "nrOpUpdateValuesCopied": 32773039, "nrOpUpdates": 1231329, "nrPrimOpCalls": 11339176, "nrThunks": 27686197, "sets": { "bytes": 913395872, "elements": 51894915, "number": 5192327 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 1220932, "number": 99185 }, "values": { "bytes": 1055012784, "number": 43958866 } }NIX_SHOW_STATS=1 nix flake checkafter{ "cpuTime": 10.344867706298828, "envs": { "bytes": 691711896, "elements": 34935067, "number": 25764460 }, "gc": { "heapSize": 738914304, "totalBytes": 3402504560 }, "list": { "bytes": 60176696, "concats": 866078, "elements": 7522087 }, "nrAvoided": 28543943, "nrFunctionCalls": 23401274, "nrLookups": 11712564, "nrOpUpdateValuesCopied": 32773039, "nrOpUpdates": 1231329, "nrPrimOpCalls": 11339176, "nrThunks": 27657492, "sets": { "bytes": 912128368, "elements": 51843610, "number": 5164413 }, "sizes": { "Attr": 16, "Bindings": 16, "Env": 16, "Value": 24 }, "symbols": { "bytes": 1220945, "number": 99186 }, "values": { "bytes": 1054323864, "number": 43930161 } }Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.