-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable function inlining by default #61
Disable function inlining by default #61
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need rush, just disable this in your build, in near future it will be fixed and released new version with patch.
Also |
@evilebottnawi It's cool that the Terser/Uglify people built the functionality, but it's useless and buggy |
@evilebottnawi Contributing to a project where inlining bugs are solved with a test case with a combination of feature flags is just bad engineering. V8 already optimizes function calls... I don't think I'm missing anything here. If I am, do tell. |
@jfo84 can you provide link on documentation or link on code where it is already optimized? Also project use difference developers which use difference ecma version. |
@evilebottnawi Yes. Here's a link to V8's JavaScript inlining heuristic: https://chromium.googlesource.com/v8/v8/+/refs/heads/lkgr/src/compiler/js-inlining-heuristic.cc |
@jfo84 And so? I can't find any benchmark with example or something related. Guys from
Also, you have negative comments about OracleDB developers. My advice - don't use OSS and no problems. |
@evilebottnawi The engines didn't inline function calls when UglifyJS was originally written. Now they do, but the code is still there. Sorry if I was a bit abrasive, but putting your head in the sand here benefits no one. Open source software is about helping everyone; it's not about politics. This is an extra layer of complexity that shouldn't exist in 2019. |
@jfo84 create issue about this in |
I ran webpack with and without the inlining feature on our production app and it decreased the bundle size by 2 KB, or 0.4% and our vendor bundle by .01 MB, or 0.4%. This doesn't feel like enough benefit for the added surface area for bugs. |
@jfo84 for you, other developers can have more than 0.4% and for bundle around |
This PR contains a:
Motivation / Use-Case
After dealing with evil bugs like this one, it seems obvious to me that function inlining behavior in tools like UglifyJS/Terser is silly. Here's another well-documented bug in UglifyJS2.
It's too aggressive, not well-documented, and pointless since engines like V8 will inline function calls anyway. Not to mention that these libaries (Uglify, Terser) are hardly maintained and the entire community still uses them. V8 has built detailed abstractions to handle function inlining in a predictable way; the approach in Terser is more reminiscent of the tales I have heard of the morass of OracleDB.
Breaking Changes
The behavior isn't documented anyway, so this is hardly breaking.
Additional Info
Bugs that disappear when you add logging are soul-destroying monsters that no engineer should ever have to deal with. Please disable this behavior by default.