question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kangaxcommented, 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.

0reactions
vigneshshanmugamcommented, May 18, 2017

lets take advantage of the plugin ordering option https://github.com/babel/babel/pull/5735

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Pass Technique - CodePath Cliffnotes
Multiple Pass Technique. Most computations on a list will require O(N) time complexity, so a simple but very useful technique is to pass...
Read more >
Multiple passes - BorisTheBrave.Com
Multiple passes are even more powerful once you realize that anything created by the first pass will be used by the second pass....
Read more >
multi-pass - Wiktionary
AdjectiveEdit. multi-pass (not comparable). Involving several passes over something. The multi-pass compiler skims the source code looking ...
Read more >
Multi-pass compiler - Wikipedia
A multi-pass compiler is a type of compiler that processes the source code or abstract syntax tree of a program several times.
Read more >
Are Multiple Passes Necessary for Permanent Data Erasure?
Do we really need multiple passes for wiping hard drives? The answer lies in understanding latest drive technology, global erasure standard, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found