-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
unoptimized code generation with tuple arguments #6670
Comments
Planning to address this. Generally, we don't specialize on all tuple types because there are just too many of them. Due to the code in inference.jl the number is actually unbounded if we aren't careful. |
Ok thanks, got a nice speedup from restructuring the code to avoid this. |
@mlubin, in case you can't wait, Jeff once mentioned a nice trick to me: write the signature as
That will force specialization. Whether this helps is quite specific for tuple inputs; in general, it's still true that in the vast majority of cases there's no performance advantage for declaring input types. |
Feel free to close if this is subsumed by another issue. |
I think the closest issue is #4090, but it's closed. |
Consider:
Type inference is essentially the same for both:
but very different llvm code is generated:
Why does the second version generate unoptimized code?
The text was updated successfully, but these errors were encountered: