ES2015 default parameters: arguments performance issue #5922
Labels
i: duplicate
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Hi guys,
Thank you very much for all your work on babel, I believe front-end development wouldn't be where it is today without it.
So, currently babel transpiles es2015 default parameters by making use of the
arguments
variable, which has performance drawbacks.Input Code
REPL link available :)
Babel Configuration (.babelrc, package.json, cli command)
Expected Behavior
Current Behavior
Possible Solution
Default parameters have historically been managed like in the "Expected behaviour" section, which is fast, I don't know much about ASTs in general so I'm not sure how trivial this is to change.
I think there might be solutions that still make use of arguments, depending on what's easier to implement, but I'd avoid it if possible.
This is one, but I'm not sure of its perf impacts, so we'll have to test it.
Context
I had been using babel's default parameters blindly and one of our functions ended up in "hot" code, which made me discover the perf problem and opening this issue.
I know that @GoodBoyDigital and @bigtimebuddy had to stop using them in some parts of PixiJs due to this problem, happy to hear your thoughts guys if you have anything to add from your perf tests.
Your Environment
Thank you,
Alvin
The text was updated successfully, but these errors were encountered: