-
Notifications
You must be signed in to change notification settings - Fork 0
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
Runtime dispatching in inner products #41
Comments
This turns out to be a case of: I did a quick test by parameterizing the function definitions from e.g. However, there is a union split or dynamic dispatch that is not detected in this |
@sjkelly Thanks! Learned something new. I'll play with this to see how it affects performance, and I'll see if I can eliminate that type instability in limits() |
For the limits function you can dispatch on a Value type so that each length value gets its own compiled function. |
This appeared to be fixed by avoiding this issue https://docs.julialang.org/en/v1/manual/performance-tips/#Be-aware-of-when-Julia-avoids-specializing . In addition, the new quadrature routines avoid most of the function evaluations in favor of predefined array summing, so this is no longer an issue. |
Right now I'm getting lots of allocations when computing the inner products in TEQUILA. It's a pretty complicated chain of function calls with intermediary functions being called. @sjkelly suggested that it's related to JuliaLang/julia#15276. The performance implications of variable capture are described here.
As suggested by @sjkelly, I tried replacing the functions defined inside of other functions with anonymous functions. I also tried introducing
let
statements and using@closure
from FastClosures.jl. None of this had any significant impact on performance. I didn't push any of the things I tried above since they didn't help, but I'm hoping to get some help identifying where I've gone wrong.Here's the simplest sequence that demonstrates the problem that I've found.
Here's the file that was used: g_chease_mxh_d3d.txt
Here's the profiling:

The text was updated successfully, but these errors were encountered: