-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[node-modules] Improve deduplication efficiency by tracking ancestor dependencies #955
Conversation
…ons the packages were not hoisted
791302b
to
5bcfa92
Compare
5399b0a
to
ecaa3a2
Compare
ecaa3a2
to
97ac7b1
Compare
@larixer In babel/babel#11167, the size of all the Let me know when I can test this PR! |
@nicolo-ribaudo Sure, I will The difference in size is certainly above what I have expected, I will test on babel repo the deduplication efficiency, since on my repo it was only 18% worser (10% due to native package installation by v2 for the cpu and os variants that are different from current OS and CPU and 8%, due to v1 and npm have bug when they quite often violate peer dependency promise in certain situations) |
I'm computing the
With yarn 1 + lerna I'm getting Detailed sizes
EDIT: I have opened #996, which is the cause of this big size difference. |
@nicolo-ribaudo Currently on this PR I have:
Could you give it a shot please? |
Somehow I get way less (644720), but all the tests are passing 👍 Also, this feels faster (I don't know if it's true), because the loading bar appears immediately instead of after a few seconds. |
@nicolo-ribaudo Yes, it is much faster, now the hoisting takes 1 second for babel. And I'm still going to improve that in next PRs :) |
@nicolo-ribaudo Oh, also the whole thing is much faster thanks to @arcanis PR: |
OMG I can't believe my eyes 😍 This is with an empty cache:
I guess that the |
🚀 |
@nicolo-ribaudo Sorry, this PR happened to be broken. I have run |
No worries, I will test the other PR when it doesn't have the "in progress" label 👍 |
What's the problem this PR addresses?
The deduplication efficiency is still poor both size-wise and performance-wise in
master
How did you fix it?
I have rewritten hoisting algorithm to hoist dependencies from the whole tree into current root node to improve performance and added ancestor dependencies tracking to improve deduplication efficiency. This has simplified algorithm in some areas (checks) and sophisticated in another areas (node cloning), but generally it is now far superior than the one used in
master
both size-wise and performance-wise. It is not yet as perfect as it can be, but it is still a good checkpoint IMO.