You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are there situations that we might need multiple passes for better minification ?
For example, one plugin might transform
if(a)foo(x) : foo(y);//toa ? foo(x) : foo(y)
and another plugin might transform
//tofoo(a ? x : y);// or even,x ? foo(a) : foo(b)//tofoo(x ? a : b)
and another one could remove this as pure expression statement. or modify it differently. I'm not able to think about it.
So the order of plugins in the preset will matter, and we say (with plugins- a and b) the order is a, b, and another particular transformation might require the order to be b, a. So, should we explore multiple passes. I'm not sure if this is a problem. Just asking if there are situations that you faced like this.
This is definitely a problem in a lot of other optimization software I used and babel-minify is no exception; I listed a couple of already-existing sorting issues here: #25 (comment) (the last two points at the end of Edit 2)
A brute force solution would be to add a preset option that simply does 2 passes. When I tested this a while ago I also saw that sometimes 3 passes can increase size even more. Not sure how to deal with this. How to strike balance between transformation time and size, where a tiny improvement can cause 2x or 3x longer times.
Activity
fregante commentedon Jul 29, 2016
This is definitely a problem in a lot of other optimization software I used and babel-minify is no exception; I listed a couple of already-existing sorting issues here: #25 (comment) (the last two points at the end of Edit 2)
boopathi commentedon Dec 5, 2016
#317 Simplify and DCE order
kangax commentedon Dec 5, 2016
A brute force solution would be to add a preset option that simply does 2 passes. When I tested this a while ago I also saw that sometimes 3 passes can increase size even more. Not sure how to deal with this. How to strike balance between transformation time and size, where a tiny improvement can cause 2x or 3x longer times.
boopathi commentedon Dec 5, 2016
this should be the mangler
boopathi commentedon Feb 12, 2017
#422 Simplify after DCE
vigneshshanmugam commentedon May 18, 2017
lets take advantage of the plugin ordering option babel/babel#5735