-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Use multipleOutputPaths
as optimization
#20
Comments
@aameen-tulip thank you for your suggestions. I’d be interested in improving this, however I’m not sure what you mean by multipleOutputPaths? |
I agree this is a pain, and I've been thinking about adding a mode that simply builds the cache as a whole, instead of per dependency. (Like how I'm not sure how multiple outputs fit in, though. I'm not that familiar beyond how Nixpkgs uses them to split bin/lib/dev/doc. I guess the benefit is, even on rebuild, an intermediate Nix cache would only have to serve what has changed? Does that still require fixed output derivations, though, and how does that work with multiple outputs? (Or, I guess, the content-addressable stuff will solve that for us in the future.) I also wonder if Nix handles 6000 outputs, or if there is some limit on it. 🙂 Aside from multiple outputs, I think the main implementation obstacle to doing a whole cache build is that we have to implement NAR and directory hashing on the JavaScript side, in order to create a fixed output derivation for the cache build. It's not super complicated, just a bunch of work.
I believe this is what preloading does? Or maybe I don't follow. 🙂 yarn-plugin-nixify/src/generate.ts Lines 296 to 353 in 9d73564
|
In my case populating the cache using
fetch-one
is painfully slow. ~6,000 dependencies, each takes ~0.3 ms to build with yarn, but ~2-4 seconds each spinning up build areas.I think that by using multiple outputs in your cache builder you could drop a massive chunk of time spent spinning up and tearing down build areas.
Because the current cache builder processes these one at a time it takes ages.
By using flat hash you won't poison the hashes by changing to multiple outputs AFAIK.
Possibly an even faster way since the yarn plugin runs externally of
nix
: when populating the nix store from an existing cache, usenix-store --add-fixed sha512 .yarn/cache/*
and modify the tarball name or something to match the expected store path name.The text was updated successfully, but these errors were encountered: