Skip to content

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Oct 13, 2021

We previously restored the most recent yarn cache if yarn.lock changed. The problem is that that cache includes all dependencies of the old lockfile. If we now install dependencies with the new lockfile, the new cache will include all dependencies of the old lockfile + all dependencies of the new lockfile. Basically, we retain all previous versions of dependencies in the cache.

Ideally we'd check-in yarn v2's offline cache so that we only ever cache the used dependencies. We would only ever have to download new dependencies wheras we now have to download all dependencies when yarn.lock changes.

Note that the yarn cache is mostly for normalizing network. Downloading CircleCI cache is more stable than downloading from the npm registry (and has a slight benefit since CircleCI cache is a single request).

This will increase pipeline duration when yarn.lock changes (~30s best case for all deps up to ~2m 00s) but reduces pipeline duration when it doesn't change (~2m 00s currently for yarn cache down to 16s best case). The number of changes to yarn.lock are far smaller than the number of other changes so this tradeoff should be worth it. Right now we're downloading 2500 MB of node_modules cache even though we only use 274 MB.

@eps1lon eps1lon added performance internal Behind-the-scenes enhancement. Formerly called “core”. labels Oct 13, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 13, 2021

No bundle size changes

Generated by 🚫 dangerJS against 28ab630

@eps1lon eps1lon force-pushed the core/bound-yarn-cache branch from 5a903c3 to 28ab630 Compare October 13, 2021 19:19
@eps1lon eps1lon marked this pull request as ready for review October 13, 2021 19:25
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in for faster CI 👍

@eps1lon eps1lon merged commit 95a36b8 into mui:master Oct 14, 2021
@eps1lon eps1lon deleted the core/bound-yarn-cache branch October 14, 2021 08:40
@eps1lon eps1lon mentioned this pull request Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Behind-the-scenes enhancement. Formerly called “core”. performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants