-
-
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
precompiling cfunction calls #12256
Comments
eventually, we need to disable the speed boost provided by calling |
One thing that would be neat, and should be entirely safe, is to automatically do |
i'm pretty sure you already thought of that before, and implemented it ( Line 85 in 8294d4f
|
Yes, |
precompile cfunction calls. fixes #12256
Unfortunately, this doesn't seem to be completely fixed. When I remove the manual precompilation from PyCall/src/PyCall.jl, the load time goes from 1.35s to 1.68s on my machine. |
we pre-infer |
@vtjnash, adding |
I noticed in JuliaPy/PyCall.jl#167 that, even after running
Base.compile
, somecfunction
calls in my__init__
function were taking a significant amount of time (0.8 seconds for 6 functions).I could work around this by adding some explicit
precompile
lines in order to ensure that these were compiled, but this raises three problems:cfunction
in__init__
should really cause the corresponding functions to be precompiled automatically.cfunction
was quite expensive: 0.25 seconds for 6 functions.precompile
causes the functions to be compiled at the wrong time — before__init__
is called rather than after. Since my__init__
initializes someglobal const
variables that are referenced in the precompiled functions, this means that type inference does not work properly when precompiling (since Julia does not know the types of those globals yet).cc: @vtjnash
The text was updated successfully, but these errors were encountered: