-
Notifications
You must be signed in to change notification settings - Fork 151
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
Unexpected allocation when splatting #784
Comments
Yes this is called the "splatting penalty". Julia "lowers" function calls with This can be a bit surpising since it (a) works correctly, (b) |
Right on Andy. See JuliaLang/julia#29114 for an extended discussion. Summary: type inference needs to model the iteration protocol because splatting is defined in terms of iteration. (There's other implementation options, but they all seem to have some undesirable properties.) |
I was surprised that
f()
allocated. I was even more surprised when I found out thatg()
does not:The text was updated successfully, but these errors were encountered: