-
-
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
Putting precompile
inside a version check eliminates the benefits
#37509
Comments
And it really seems to be the version-check: this diff diff --git a/src/Gaston.jl b/src/Gaston.jl
index 2731d24..4dc30fe 100644
--- a/src/Gaston.jl
+++ b/src/Gaston.jl
@@ -91,4 +91,12 @@ function __init__()
return nothing
end
+function _precompile_()
+ ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
+ # VERSION >= v"1.4.2" || return nothing
+ @assert precompile(plot, (UnitRange{Int},))
+ @assert precompile(display, (Figure,))
+end
+_precompile_()
+
end works fine until you uncomment the VERSION check. It fails to deliver a benefit even if you put it in |
While precompiling, |
😮 I get the same version. |
It is set at the top of the file!!!! |
Oh my god that is funny...took me like a minute to stop laughing. How could I not have thought to check that? |
I would be lying if I said I didn't re-build julia a couple of times with various |
LOL! Seriously, sorry for causing such confusion guys! I'll make sure to change that variable name in the next release. |
That is a totally reasonable variable name to use as long as it's not exported. You just need to use |
Yes, I think we all know. But apparently it is quite easy to mess up while doing so. |
I'm just recommand against breaking the package API because of this. |
Either way, no worries @mbaz: as of today, 1.0.2 is my new favorite number! |
I used |
No, it was just a namespace problem. |
On 1.6, if you add this diff to Gaston.jl:
then you shave about 0.4s off TTFP (note
juliamns
is an alias forjulia-master --startup-file=no
):But now put those
precompile
statements inside a conditional (to circumvent #29859):and you get no benefit:
The text was updated successfully, but these errors were encountered: