Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Improve the minification speed #71

Closed
avesus opened this issue Dec 31, 2017 · 1 comment
Closed

Improve the minification speed #71

avesus opened this issue Dec 31, 2017 · 1 comment

Comments

@avesus
Copy link

avesus commented Dec 31, 2017

Minification sample: @angular/core.

0.2.0 consumes 20 seconds of precious developer time on default settings (unfortunately, I had to use cheap-module-source-map and turn off the devtool: 'source-map' setting because of the weird bug #68).

Bundling with UglifyJSPlugin takes 2 seconds with "generator" settings (mangle and compress equals false), and 8 seconds on maximum settings (with compress: { passes: 2 }).

Bundling the same code with webpack without any minifiers, then passing the generated bundle to the babylon parser, and printing the resulting AST with @babel/generator takes 3 seconds.

The "generator" settings are very important nowadays, when everything can be gzipped and sent over HTTP/2.

The fancy ES Modules do have unsolvable problem of race conditions on updates, so bundling will be always actual and necessary on serious deployments with high loads.

One interesting philosophy is "code isomorphism between production and development environment" which encourages developers to work with and debug the same code which clients finally use.

To simplify debugging of production bundles, use of variables mangling and compression (which may flatten nested function calls etc.) should be avoided. Such simple minification setting improves the speed of bundle code generation, which is great.

I was expecting that the plugin may do its work very fast, but even was unable to disable the mangle setting.

@boopathi
Copy link
Member

boopathi commented Jan 3, 2018

This issue is not related to this webpack plugin. I'll close this here. We are already working on improving babel-minify's performance and babel-7 upgrade. Feel free to open issues in babel-minify repository for babel-minify related issues.

Thanks!

@boopathi boopathi closed this as completed Jan 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants