Draft
Conversation
Member
|
This looks like an amazing improvement. Is there something that could be done to get this merged? |
Member
Author
|
IIRC, there was some segfault. I can have a look at cherry-picking at least the commits that don't break anything. |
c401d65 to
b6c71b6
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
I marked this as stale due to inactivity. → More info |
05acfa2 to
80d5a3e
Compare
80d5a3e to
8bd88f2
Compare
Merged
Previously an expression like 'x: y: ...' would create two environments with one value. Now it creates one environment with two values. This reduces the number of allocations and the distance in the environment chain that variable lookups need to traverse. On $ nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux this gives a ~30% reduction in the number of Env allocations.
8bd88f2 to
5253cb4
Compare
Member
edolstra
added a commit
to edolstra/nix
that referenced
this pull request
Nov 16, 2021
This is not really useful on its own, but it does recover the
'infinite recursion' error message for '{ __functor = x: x; } 1', and
is more efficient in conjunction with NixOS#3718.
Fixes NixOS#5515.
This was referenced Nov 16, 2021
Member
Author
dramforever
pushed a commit
to dramforever/nix
that referenced
this pull request
Nov 27, 2021
This is not really useful on its own, but it does recover the
'infinite recursion' error message for '{ __functor = x: x; } 1', and
is more efficient in conjunction with NixOS#3718.
Fixes NixOS#5515.
|
I marked this as stale due to inactivity. → More info |
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.
Functions can now take more than one argument and function applications can apply more than one argument at a time. For non-partially applied functions/primops, this avoids allocation of application thunks. Also, it allows merging of environments (e.g. in a function like
x: y: ..., we only allocate one environment).On
nix-env -qa -f '<nixpkgs>', this gives a ~8.5% speedup, reduces the number of environment allocations by 29.5% and the number of value allocations by 4.8%.