-
Notifications
You must be signed in to change notification settings - Fork 47
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
Successfully precompile _parse_colorant
#445
Conversation
Codecov Report
@@ Coverage Diff @@
## master #445 +/- ##
=========================================
Coverage ? 92.54%
=========================================
Files ? 10
Lines ? 952
Branches ? 0
=========================================
Hits ? 881
Misses ? 71
Partials ? 0
Continue to review full report at Codecov.
|
BTW, is there a documented way somewhere to determine if the precompilation was successful or not? I will learn it for future uses. If the calling Also, does the order of execution of |
Just check the list returned from julia> using SnoopCompileCore
julia> tinf = @snoopi tmin=0.01 (using Colors; Colors._parse_colorant("rgb(255,0,0)"))
Tuple{Float64, Core.MethodInstance}[] But if you leave the new
It doesn't matter. Would you prefer the other order? I don't care which we pick.
It shouldn't...but then again, I was surprised that |
I don't have a strong preference for the place or order of the definitions themselves (i.e., I don't think this PR needs to be modified), but I would like to clarify what is needed for this measure and what is not. I was just curious because I thought that |
Not sure I understand what you mean by this. |
I don't understand the intent of the |
This is an expensive method to infer (>50ms on my machine) and it has never precompiled successfully. It turns out that calling it during module definition makes it non-precompilable. I am guessing that this is because there end up being backedges to something in the temporary process that does the precompilation that is no longer available, perhaps gensyms in macro expansion? In any case, avoiding the call works around the problem.
a8f8a52
to
c53bfec
Compare
Ah, I get it! Actually it's not necessary, it was leftover from earlier attempts to fix this. It's actually the deletion of the Updated. |
The julia> foo(x) = 1
foo (generic function with 1 method)
julia> precompile(foo, (Int, String))
false
julia> foo(1, "weird")
ERROR: MethodError: no method matching foo(::Int64, ::String)
Closest candidates are:
foo(::Any) at REPL[2]:1
Stacktrace:
[1] top-level scope
@ REPL[4]:1 It's essentially a guard against the precompile silently going stale as we change things. |
This is an expensive method to infer (>50ms on my machine) and it
has never precompiled successfully. It turns out that
calling it during module definition makes it non-precompilable.
I am guessing that this is because there end up being backedges
to something in the temporary process that does the precompilation
that is no longer available (perhaps gensyms in macro expansion?).
In any case, avoiding the call works around the problem.