Skip to content
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

What's the idea behind compressing cached output #571

Closed
thymikee opened this issue Feb 2, 2018 · 1 comment
Closed

What's the idea behind compressing cached output #571

thymikee opened this issue Feb 2, 2018 · 1 comment

Comments

@thymikee
Copy link
Contributor

thymikee commented Feb 2, 2018

Babel Loader Version:
current (8.0.0-beta.0) but I believe it stays since beginning (or at least 6.x)

Current behavior:
When cacheDirectory option is set, babel-loader stores the cached transforms as compressed files (using zlib).

Expected/desired behavior:
I'm actually curious what's the idea behind compressing cache?

The only reason I can see is to make node_modules take less place (as node_modules/.cache/babel-loader is the default cache dir)

The drawback, however, is spending quite some time compressing and decompressing (not to mention stringifying and parsing prior to that).

Would you be interested in accepting a PR that at least would make compression customisable?

@thymikee
Copy link
Contributor Author

thymikee commented Feb 5, 2018

BTW, I have a working PoC locally.
For 2.5k files transformed I've seen ~2.1% improvement (cache size jumped from 7.9MB to 30.1MB) on cold run, Node v9.2.0.

It doesn't seem much but it's always something, especially when you transpile a lot modules, like in React Native projects for example, or have 10k+ components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant