-
Notifications
You must be signed in to change notification settings - Fork 100
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
Make npm api requests in parallel #181
Comments
Would agree to rewrite node2nix to use async/await builtins instead of slasp? |
It is not necessarily blocking, but it currently only performs one requests at the time and was not made to do any downloads a parallel. It could be done with promises/async/await, but there also other ways. I have not done any experiments yet, but having the ability to have multiple downloads in parallel could be beneficial to the generation speed. |
Is the api client that only performs one request at the time? The rest looks like it should be asynchronous. |
nixpkgs |
@raboof Although having parallel downloads might shave off a bit of processing time, I believe what we really want is the ability to partially regenerate the expression for only the package that needs to be added or changed. I'm currently investigating options to make that possible. Not this feature is not useful, but what I expect to happen is that if we make the regeneration process faster, people will add more packages eventually nullifying its effect. With partial regenerations, we can have faster updates, and better commits on a per package basis. |
That would be really great. Also to enable backports |
That sounds great. I didn't see an issue for this yet, so I filed #192. |
I tried to replace It has speed up fetching about 2x in good network environment but makes the output non-deterministic, which are differences like Line 148 in bfd517c
|
Is there a way to force newest versions instead of the first version in the outer layer, assuming that newer versions are better? That should make it deterministic as well. |
I think the order affects not only the output layout, but also the version selection result. The version resolution algorithm seems to be quite naive now. |
Also there determinism could be achieved by going for the newest possible version for every constraint, but I am not sure if this is what the users want. |
@Mic92 Always picking the newest version is not going to work -- the fact that this does not always happen is intentional. If we would choose to alter this behaviour, then compatibility with certain packages is most likely going to break. Sadly, NPM always tries to "reuse" dependencies that fit within a certain version range in a I had several commercial projects that would fail to deploy if I would not replicate this very odd and illogical behaviour. To discover this, I did quite a few intensive comparisons between node2nix and the vanilla NPM. Furthermore, this is also NPM's means to break out of cyclic dependencies. If we always resolve to the latest version, then certain deployments will remain stuck in an infinite loop. @oxalica Thanks for trying to optimize this. Although we have to give it some more thought, it is good to hear that there is a speed up possible. |
Sorry to bump this old issue , but has there been any advancements in solving this issue ? |
It seems that node2nix currently performs blocking requests:
Maybe you can explain why this happens as you also seem to maintain the asynchronous abstraction behind it: https://github.com/svanderburg/slasp
The text was updated successfully, but these errors were encountered: