More optimizations
See original GitHub issue- Remove unused args (e.g.
bar
infunction foo(bar) { }
) - Remove space after
return
when possible (e.g.return [1,2,3]
→return[1,2,3]
) -
var result = expression(); foo.bar = result;
→foo.bar = expression()
- Better constant propagation (looks like it is in the dead-code-elimination plugin, but its a combination of both)
var b = () => {
var x = 14;
var y = 7 - x / 2;
return y * (28 / x + 2);
};
var a = () => {
var a = 14;
return (7 - a / 2) * (28 / a + 2);
};
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (22 by maintainers)
Top Results From Across the Web
Top 10 Essential Website Optimization Strategies
This post will delve into which factors carry the most weight and how to optimize for each. 1. Search Intent. As machine learning,...
Read more >Optimize More! - Plugins - WordPress.org
Optimizing web pages is really just about controlling how assets are delivered. This plugin gives you the ability to choose different assets to...
Read more >Optimize Definition & Meaning - Merriam-Webster
The meaning of OPTIMIZE is to make as perfect, effective, or functional as possible. How to use optimize in a sentence.
Read more >Optimize Options (Using the GNU Compiler Collection (GCC))
Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With -O , the compiler tries to reduce...
Read more >Optimization tips for Performance Max - Google Ads Help
Because of this, we recommend using the following best practices to set up your Performance Max campaigns for success and help further optimize...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can’t turn function functions into arrow functions. It’s an unsafe optimisation. Arrow functions have no
prototype
and cannot be used as constructors so they aren’t the same.Coming from #591, where @loganfsmyth suggested (after some discussion) that babel-minify place a
_void0
or similar variable at the top, then replace all uses ofundefined
with it, allowing for mangling:It should be possible to either put the
var _void0
variable at the top ofsourceType: module
scripts or ones that are node modules. In other cases, they can be put at the top of function scopes, or the entire code could be wrapped in a block:This would increase code size if
void 0
only appeared once, but would save 5 characters if used twice and 11 if used thrice.