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

Cache #46

Closed
rauchg opened this Issue Nov 25, 2018 · 2 comments

Comments

2 participants
@rauchg
Copy link
Contributor

rauchg commented Nov 25, 2018

We need a simple yet effective strategy to make several invocations of ncc build or ncc run in a row re-use as much work as possible.

  • FS cache for the CLI
    • Uses the most appropriate location for each OS (like yarn)
    • Flag to ignore it for both run and build (--no-cache)
    • Subcommands to find it and clean it (ncc cache dir and ncc cache clean)
  • In-memory interface for the programmatic API (ncc())

@rauchg rauchg added the enhancement label Nov 25, 2018

@guybedford

This comment has been minimized.

Copy link
Collaborator

guybedford commented Dec 5, 2018

Of the time spent in the build, over 50% is now spent on minification, with only a very small fraction of time spent in the relocation loader.

Unfortunately Webpack internals don't seem like they offer much in the way of persistent caching right now (correct me if I'm wrong, but got this from - webpack/webpack#6527).

So I think the initial focus needs to be on minification (and TypeScript support when merged).

So the question then is how to properly cache minification in a way that can be shared between builds.

One option here could be running minification as a loader, having it apply per-input-source before Webpack does its tracing and concatentation. This would rely on caching all the other loaders and their emissions as well (including the relocation loader) and then having the previously generated source used when the input matches.

I'm not sure that per-source minification is a proven approach (please let me know if I'm wrong), so this would be yet to be seen what wins can be made here.

@guybedford

This comment has been minimized.

Copy link
Collaborator

guybedford commented Jan 18, 2019

This can be considered completed given that we are now running the Webpack v5 cache with these options enabled.

@guybedford guybedford closed this Jan 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment