-
-
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
use type inference world in return_type
#30470
Conversation
Backport eligible for 1.0.x or 1.1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, good! And so continues the creation of a separate static library for Inference! :)
@@ -633,7 +633,12 @@ end | |||
|
|||
|
|||
function return_type(@nospecialize(f), @nospecialize(t)) | |||
params = Params(ccall(:jl_get_tls_world_age, UInt, ())) | |||
world = ccall(:jl_get_tls_world_age, UInt, ()) | |||
return ccall(:jl_call_in_typeinf_world, Any, (Ptr{Ptr{Cvoid}}, Cint), Any[_return_type, f, t, world], 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ptr{Any} might be more accurate, although legacy C compatibility generally demands that Cvoid is the same, I think escape analysis may see them differently.
ef5545f
to
27f7d7d
Compare
Note that if this is backported it requires #30483. |
(cherry picked from commit a5a5882)
I found that one large source of latency in code loading is that we're repeatedly compiling the type inference code when it's called from
return_type
, since the type inference code in the system image is for a different world. This instead re-uses the precompiled world.Significantly helps #15048. With this, precompiling DataFrames goes from 77 to 50 seconds, and precompiling JuliaDB goes from 130 to 75 seconds.