-
-
Notifications
You must be signed in to change notification settings - Fork 179
[v1.0.0-beta.2] parallelization isn't working #97
Comments
in package.json if you're interested |
So I think maybe the worker farm configuration was off? |
I have also observed something similar. It is creating two workers and one of them is peaking and the other one is idling. The package @stevefan1999 suggested did provide me performance boosts as well. |
@stevefan1999 @ahumblenerd I need your more info about your setups please ( |
@michael-ciniawsky Sorry for responding lately, I have other works to do. Here it is my config (actually import UglifyJSPlugin from 'uglifyjs-webpack-plugin'
export default {
getUglifyJsPluginOptions (config) {
return config.plugins.find(p => p.constructor.name === 'UglifyJsPlugin').options // there's one and only UglifyJsPlugin
},
removeUglifyJsPlugin (config) {
// create a clone of config.plugins without UglifyJsPlugin
delete config.plugins.filter(p => p.constructor.name === 'UglifyJsPlugin')[0]
config.plugins = config.plugins.filter(p => p.constructor.name !== 'UglifyJsPlugin')
},
addUglifyEsPlugin (config, opts) {
const plugin = new UglifyJSPlugin({
parallel: true,
sourceMap: opts.sourceMap,
uglifyOptions: { // UglifyJS config for every workers
...opts,
ecma: 5
}
})
config.plugins.push(plugin)
},
webpack (config, { dev }) {
if (!dev) {
const opts = this.getUglifyJsPluginOptions(config)
this.removeUglifyJsPlugin(config)
this.addUglifyEsPlugin(config, opts)
}
return config
}
} I didn't see any issues there |
@stevefan1999 found problems when ending #108 PR, |
@stevefan1999 Could you try the latest |
I'm seeing an error when passing an object to parallel:
|
|
@zbjornson can you create minimum reproducible test repo with latest beta version? |
Well I was hacking next.js and tried to play with the new toy in town
I attempted to remove the old uglifyJs from webpack and installed the beta version back into the plugins config in wepback:
So then I built several times
~22s, this is pretty slow...
I can validate uglify-es is working by checking the output(which is originally ES6+)
So I decided to turn off parallelization:
Shockingly the build time is almost the same with parallel option off!
What. The. Hell. I never realized there's no parallelization!
But even without parallelization there the cache mechanism should have left in effect. I turned back on the parallel option.
Strangely the cache folder is created:
But it doesn't turn the game up whatsoever...Even after post-cache-build...
Interesting, but what in the world just happened?
I have a beast 16-cores Xeon E5 high performance workstation and it definitely kills parallel jobs!
And I don't think I have wrongfully configured UglifyJSPlugin...
I ran fine with webpack-parallel-uglify-plugin and it really speeds up by a factor of 3_(~22s -> ~8s, close to raw compilation time without any minification)_...Not in this case though.
You may say why shouldn't I adapt to the webpack-parallel-uglify-plugin I used to but because I'm preparing for the future.
I can simply switch back, but it definitely kills my intent...
WELL ANYWAY PLZ FIX
I'm sorry if my wordings are kinda ambiguous, but English is not my mother tongue, heh
The text was updated successfully, but these errors were encountered: