-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Terser vs. UglifyJS - Dramatic Improvements #15
Comments
@anton164 Thanks! Unfortunately performance are not exists. I heard about increase perf from many developers. Looks guys from
My recommendation is switch to |
Also |
Great, thanks! That gives me the confidence to proceed :) Will add some more performance tests once I get a hold of them |
Hi! After seeing this, I tried comparing Is it possible there were other differences in config/environment? For example, the default webpack configuration using Also, the new webpack-sources v1.2.0 contains a significant performance improvement (webpack/webpack-sources#32), and whilst both That said, |
Here's my config, which does include source maps:
I am again experiencing issues, so you're proabably right @edmorley. I believe my issue is related to webpack-contrib/uglifyjs-webpack-plugin#272, however it doesn't happen consistently, and the issue with long builds seems to resurface in CircleCI. It's a large bundle, so creating a minimum reproducible test case isn't straight forward. |
Context: webpack-contrib/terser-webpack-plugin#15 terser supports ES6 and is faster on all the benchmarks I can find, so seems like the correct lib
Perhaps this belongs in the
terser
repo, but I thought I'd give it a go here.We're developing a fairly large scale single page application, and we've been experiencing tedious problems with UglifyJS recently - minifying takes up to ~35 minutes, hence we're looking for a better solution.
I just tested out this plugin, and the difference is astonishing. Here are some results:
Without cache:
UglifyJsPlugin took 34 mins, 32.53 secs
UglifyJsPlugin took 32 mins, 7.82 secs
TerserPlugin took 13 mins, 38.86 secs
TerserPlugin took 12 mins, 12.99 secs
TerserPlugin took 5 mins, 33.013 secs 🚀
With cache:
UglifyJsPlugin took 3 mins, 43.85 secs
UglifyJsPlugin took 3 mins, 5.26 secs
TerserPlugin took 1 min, 32.78 secs
So Terser seems to speed it up by 3x and since it took me just about 2 minutes to switch from UglifyJS it seems almost too good to be true.
Is this to be expected? I'm basically looking for some confirmation from others. I haven't been able to find any performance tests elsewhere.
Anyhow, great work, this looks very promising! 💯
The text was updated successfully, but these errors were encountered: