Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refering to channel: in search path got significantly slower in nix 2.21+ #10946

Open
xzfc opened this issue Jun 23, 2024 · 0 comments
Open

Refering to channel: in search path got significantly slower in nix 2.21+ #10946

xzfc opened this issue Jun 23, 2024 · 0 comments
Labels

Comments

@xzfc
Copy link
Contributor

xzfc commented Jun 23, 2024

Previously, it was taking less than 0.1 seconds to refer to a channel, but now it's 5+ seconds.
Might be related: verbose output includes this line: source path '«unknown»/' is uncacheable.

Old (fast)

$ nix --version
nix (Nix) 2.20.6

$ time nix-instantiate -I n=channel:nixos-23.05 -E --eval "<n>"
/nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source

real    0m0.029s
user    0m0.013s
sys     0m0.011s

$ nix-instantiate -vvvv -I n=channel:nixos-23.05 -E --eval "(import <n> {}).lib.fakeHash" |& ts -s
00:00:00 evaluating file '<nix/derivation-internal.nix>'
00:00:00 performing daemon worker op: 11
00:00:00 acquiring write lock on '/nix/var/nix/temproots/1007652'
00:00:00 performing daemon worker op: 1
00:00:00 using cache entry '{"name":"source","type":"tarball","url":"https://nixos.org/channels/nixos-23.05/nixexprs.tar.xz"}' -> '{"etag":"\"3609b92639bb1b75344c6300d9513105\"","lastModified":1704616576}', '/nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source'
00:00:00 resolved search path element 'channel:nixos-23.05' to '/nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source'
00:00:00 /nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source

New (slow)

$ nix --version
nix (Nix) 2.22.1

$ time nix-instantiate -I n=channel:nixos-23.05 -E --eval "<n>"
/nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source

real    0m5.354s
user    0m2.459s
sys     0m0.660s

$ nix-instantiate -vvvv -I n=channel:nixos-23.05 -E --eval "(import <n> {}).lib.fakeHash" |& ts -s
00:00:00 evaluating file '<nix/derivation-internal.nix>'
00:00:00 using cache entry '{"_what":"tarballCache","url":"https://nixos.org/channels/nixos-23.05/nixexprs.tar.xz"}' -> '{"etag":"\"3609b92639bb1b75344c6300d9513105\"","lastModified":1704616576,"treeHash":"81fbe527509ebdf4d35a954750efa488ebff2aed"}'
00:00:00 source path '«unknown»/' is uncacheable
00:00:00 copying '«unknown»/' to the store...
00:00:00 performing daemon worker op: 7
00:00:03 acquiring write lock on '/nix/var/nix/temproots/1005446'
00:00:05 resolved search path element 'channel:nixos-23.05' to '/nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source'
00:00:05 /nix/store/qinxwzj1pxwg37i5x89kh2m7iap5svqa-source

Priorities

Add 👍 to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant