-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Arguments casting to array. #311
Comments
In this particular case we're favoring readability > performance. Directly assigning to an Array with a fixed length (like it mentions in the bluebird docs for "Workaround") is way faster anyway but that doesn't mean we should always favor that pattern. |
Well, just so long as you're comfortable totally forgoing javascript optimizations everywhere that pattern is used. Afaik, no browser can or will ever optimize if you leak arguments. For this reason, I find this to be bad advice. You're taking a shortcoming of the language (the It's not just the act of the copying to an array either. It's the entire containing function. The whole thing is marked un-optimizable. |
Thankfully we've got rest in es6 so we don't have to ever use |
Since now we should be using the rest operator, I'm going to close this. |
The current advice,
Actually breaks v8's compiling optimizer, just fyi. Any function you do that to can not be optimized. See the bluebird docs for more info.
Also, see my question on StackOverflow.
The text was updated successfully, but these errors were encountered: