Skip to content

Multiple passes? #61

Open
Open

Description

@boopathi

Are there situations that we might need multiple passes for better minification ?

For example, one plugin might transform

if (a) foo (x) : foo (y);
//to
a ? foo (x) : foo (y)

and another plugin might transform

//to
foo (a ? x : y);

// or even,
x ? foo(a) : foo(b)
//to
foo (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.

Activity

  1. fregante commented on Jul 29, 2016

    @fregante
    Contributor

    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)

  2. boopathi commented on Dec 5, 2016

    @boopathi
    MemberAuthor

    #317 Simplify and DCE order

  3. kangax commented on Dec 5, 2016

    @kangax
    Member

    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.

  4. boopathi commented on Dec 5, 2016

    @boopathi
    MemberAuthor

    3 passes can increase size even more

    this should be the mangler

  5. boopathi commented on Feb 12, 2017

    @boopathi
    MemberAuthor

    #422 Simplify after DCE

  6. added this to the 1.0 milestone on Apr 6, 2017
  7. vigneshshanmugam commented on May 18, 2017

    @vigneshshanmugam
    Member

    lets take advantage of the plugin ordering option babel/babel#5735

  8. removed this from the 1.0 milestone on Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions