-
-
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
inline inexact method matches #6677
Conversation
…h sprintf, so it is faster than before
I think the problem is that we construct an expression of type Also this should throw method errors, not typeasserts. |
that was much harder than expected to match all of the possible method matches to their arguments i still need to convert the typeasserts into a no method error. any idea why I can't inline methods with a type of Undef? (ps. this does fix the performance regression it was supposed to fix) |
What is a "method with a type of Undef"? You mean where an argument has type "Undef"? Can you describe the performance regression in more detail? What call site was affected? Obviously inlining more things helps generally, but I'm curious about how this came up in practice. |
Yes, the latter. I can inline a call1 method, unless Undef appears and confuses the compiler It came up in the printf branch, where I was depending on the right specialized method being inlined for performance (see perf test change in this commit. When I have more time, I'll rerun the full perf test and see what else it affects) |
this doesn't have any impact on the perf tests, other than to make the jn/printf2 branch as fast as before without resorting to editing the test :) it is also ready to merge |
this change would be even more interesting for applying outside of the inliner, to specialize call1 functions that we do not want to inline. however, that's work for another day (free free to open an issue and tag me on it if you want this soon) |
Got another mystery for you Jeff. Why can't the ASCIIString constructor call the
|
Why is |
Also, why is this call to |
I thought top() got you these function, but perhaps not. Do I need getfield instead? I was wondering the same, until I remembered this was a stress test where I was applying the argument test to all function calls |
ok, it was harder than expected to convert the typeasserts into a MethodError, but I seem to have succceeded |
|
That's quite a slowdown in spectralnorm. Would be good to get a handle on the cause. |
yes. however, i see now that the slowdown is unrelated to this pull request -- master is giving me the same timings too |
Unfortuantely, the due to codespeed breakage, we don't have the exact commit that this slowdown was introduced by, but we do get a range. EDIT: updated above link to look at the |
Ok, it's kind of a relief that the slowdown is not due to this PR, because that would be weird. |
git bisect gave me e805fd6 that's a logical commit to have caused the slowdown -- i'll tweak the threshold again |
@JeffBezanson ping |
@JeffBezanson Do you know where this going wrong?
if !(aeitype <: methitype)
appears to be failing, even though I haven't removed the precondition test ofif !(atypes <: meth[1])
inspired by 024bbce#commitcomment-6137158
Is the following behavior correct? I think it must be true, but is also causing type-inference issues with this patch on the indicated line