Skip to content
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

Merged
merged 1 commit into from
Jan 3, 2019
Merged

Conversation

JeffBezanson
Copy link
Member

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.

@JeffBezanson JeffBezanson added the compiler:latency Compiler latency label Dec 20, 2018
@ararslan
Copy link
Member

Backport eligible for 1.0.x or 1.1?

Copy link
Member

@vtjnash vtjnash left a 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)
Copy link
Member

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.

@JeffBezanson
Copy link
Member Author

Note that if this is backported it requires #30483.

@JeffBezanson JeffBezanson merged commit a5a5882 into master Jan 3, 2019
@JeffBezanson JeffBezanson deleted the jb/rettypeworld branch January 3, 2019 03:46
KristofferC pushed a commit that referenced this pull request Jan 9, 2019
This was referenced Jan 9, 2019
@StefanKarpinski StefanKarpinski added backport 1.0 triage This should be discussed on a triage call and removed backport 1.0 triage This should be discussed on a triage call labels Jan 31, 2019
@StefanKarpinski StefanKarpinski added triage This should be discussed on a triage call and removed triage This should be discussed on a triage call labels Jan 31, 2019
@JeffBezanson JeffBezanson removed triage This should be discussed on a triage call triage backport pending 1.0 labels Jan 31, 2019
@KristofferC KristofferC mentioned this pull request Feb 4, 2019
39 tasks
KristofferC pushed a commit that referenced this pull request Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants