-
Notifications
You must be signed in to change notification settings - Fork 82
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
Better precompilability #287
Conversation
After #259, the result of `filename(q)` is not inferrable. This uses "the kernel trick" to provide a single point where the result must be inferred, and an `invokelatest` to prevent the abstract signature from being inferred. It then precompiles the `::String` variant. Consequently, with respect to latency this should get us back to where we were before #259.
For reasons I don't fully understand, either the string interpolation or the error messes up precompilation of `applicable_loaders`. This splits it out into a separate function and calls it via `invokelatest` to prevent it from blocking precompilation.
I haven't seen this warning come up in a long time, so I don't think this code is active. It adds significant latency due to the time needed to infer the Pkg calls, so let's ditch it. xref #226.
The first commit seems fine to me, though I don't fully understand why |
It's because |
Oh, I see. It was specifically this change https://github.com/JuliaIO/FileIO.jl/pull/259/files#diff-525588e68b2421901be164965272940effa093de733a3fd36c4b9a4344b8c20cL29 that's causing the problem. The term |
Parametrization might be undesirable from a latency perspective: any method accepting a |
These allow more concrete inference and eliminate some weird sources of latency. Very briefly, the first commit compensates for #259 (CC @rofinn, @omus), the last implements the conclusion of discussion in #226 (CC @johnnychen94). All part of a grand scheme to reduce latency (e.g., JuliaGraphics/Gtk.jl#551 (comment)).